@Override
public List<IBuilding> findBuildings(ICity city,Class<? extends IBuilding> buildingClass) {
List<IBuilding> result = new ArrayList<IBuilding>();
for (IBuilding buidlding : city.getBuildings()) {
ClassChecker checker = new ClassChecker(buidlding.getClass());
if (checker.extendsClass(buildingClass) || checker.implementsInterface(buildingClass)){
result.add(buidlding);
}
}
return result;
}