示例#1
0
 /**
  * @param date the date which they should have been active
  * @return a {@link Collection} with the {@link CountrySubdivision} that were active on the given
  *     date and of the
  */
 public Collection<CountrySubdivision> getChildrenValidAt(LocalDate date) {
   Collection<Unit> units = getChildUnits().collect(Collectors.toList());
   Collection<CountrySubdivision> children = new ArrayList<CountrySubdivision>();
   for (Unit unit : units) {
     final AccountabilityType type = getOrCreateAccountabilityType();
     unit.getParentAccountabilityStream()
         .filter(a -> a.getAccountabilityType() == type && a.isActive(date))
         .forEach(a -> children.add((CountrySubdivision) unit.getGeographicLocation()));
   }
   return children;
 }