List<NestingRule> () { List<NestingRule> result = new ArrayList<>(); final ProjectViewNestingRulesProvider.Consumer consumer = (parentFileSuffix, childFileSuffix) -> { LOG.assertTrue(!parentFileSuffix.isEmpty() && !childFileSuffix.isEmpty(), "file suffix must not be empty"); LOG.assertTrue(!parentFileSuffix.equals(childFileSuffix), "parent and child suffixes must be different: " + parentFileSuffix); result.add(new NestingRule(parentFileSuffix, childFileSuffix)); }; for (ProjectViewNestingRulesProvider provider : EP_NAME.getExtensions()) { provider.addFileNestingRules(consumer); } return result; }