[Solved] Returning specific type of Object that extends Object?

	public Component findComponentOfType(Class<? extends Component> componentType){
		
		Component thisComponent = null;

		for(int i = 0; i < components.size(); i++){
			if(components.get(i).getClass().equals(componentType)){
				thisComponent = components.get(i);
			}
		}
		

		return (componentType.cast(thisComponent));
}

I’m trying to convert thisComponent to the same type of componentType and return it to use as componentType in another method. They both extend the same class which is Component.
I’m assuming it has something to do with me not knowing how to make my method as generic as possible. Any ideas?

public Component findComponentOfType