ConstantAffection (final Collection<? extends ConstantAffection> affections) { if (affections.isEmpty()) { return new ConstantAffection(Collections.emptyList()); // return a 'known' affection here } if (affections.size() == 1) { return affections.iterator().next(); } for (ConstantAffection a : affections) { if (!a.isKnown()) { return EMPTY; } } final Collection<File> affected = new SmartList<>(); for (ConstantAffection affection : affections) { affected.addAll(affection.getAffectedFiles()); } return new ConstantAffection(affected); }