final List<Unit> result = new ArrayList<Unit>();
final YearMonthDay today = new YearMonthDay();
final Predicate predicate = new Predicate() {
@Override
public boolean evaluate(Object arg0) {
final UnitName unitName = (UnitName) arg0;
final Unit unit = unitName.getUnit();
return unit instanceof UniversityUnit && unit.isActive(today);
}
};
for (final UnitName unitName : UnitName.findExternalUnit(value, maxCount, predicate)) {
final Unit unit = unitName.getUnit();
result.add(unit);
}
return result;
}