Source:
private void addBindings(List<ComponentConfig.Binding> bindingEntries, Bindings bindings, String componentName, Set<Fragment> componentFragments, Set<Component> componentDependencies) { if (bindingEntries == null || bindingEntries.isEmpty()) { return; } Map<String, Fragment> availableFragments = new HashMap<>(); componentFragments.forEach(fragment -> availableFragments.put(fragment.getName(), fragment)); componentDependencies.forEach(cmp -> cmp.getFragments().forEach(f -> availableFragments.put(f.getName(), f))); for (ComponentConfig.Binding entry : bindingEntries) { if (entry.getZoneName() == null) { throw new MalformedConfigurationException( "Zone name of a binding entry cannot be null. Found such binding entry in component '" + componentName + "'."); } else if (entry.getZoneName().isEmpty()) { throw new MalformedConfigurationException( "Zone name of a binding entry cannot be empty. Found such binding entry in component '" + componentName + "'."); } String zoneName = NameUtils.getFullyQualifiedName(componentName, entry.getZoneName()); if (entry.getFragments() == null) { throw new MalformedConfigurationException( "Fragments in a binding entry cannot be null. Found such binding entry in component '" + componentName + "'."); } List<Fragment> fragments = new ArrayList<>(entry.getFragments().size()); for (String fragmentName : entry.getFragments()) { Fragment fragment = availableFragments.get(NameUtils.getFullyQualifiedName(componentName, fragmentName)); if (fragment == null) { throw new IllegalArgumentException( "Fragment '" + fragmentName + "' given in the binding entry '" + entry + "' does not exists in component '" + componentName + "' or its dependencies " + componentDependencies.stream().map(Component::getName).collect(joining(",")) + "."); } fragments.add(fragment); } bindings.addBinding(zoneName, fragments, entry.getMode()); } }

Target:
private void addBindings(List<ComponentConfig.Binding> bindingEntries, Bindings bindings, String componentName, Set<Fragment> componentFragments, Set<Component> componentDependencies) { if (bindingEntries == null || bindingEntries.isEmpty()) { return; } Map<String, Fragment> availableFragments = new HashMap<>(); componentFragments.forEach(fragment -> availableFragments.put(fragment.getName(), fragment)); componentDependencies.forEach(cmp -> cmp.getFragments().forEach(f -> availableFragments.put(f.getName(), f))); for (ComponentConfig.Binding entry : bindingEntries) { if (entry.getZoneName() == null) { throw new ConfigurationException( "Zone name of a binding entry cannot be null. Found such binding entry in component '" + componentName + "'."); } else if (entry.getZoneName().isEmpty()) { throw new ConfigurationException( "Zone name of a binding entry cannot be empty. Found such binding entry in component '" + componentName + "'."); } String zoneName = NameUtils.getFullyQualifiedName(componentName, entry.getZoneName()); if (entry.getFragments() == null) { throw new ConfigurationException( "Fragments in a binding entry cannot be null. Found such binding entry in component '" + componentName + "'."); } List<Fragment> fragments = new ArrayList<>(entry.getFragments().size()); for (String fragmentName : entry.getFragments()) { Fragment fragment = availableFragments.get(NameUtils.getFullyQualifiedName(componentName, fragmentName)); if (fragment == null) { throw new IllegalArgumentException( "Fragment '" + fragmentName + "' given in the binding entry '" + entry + "' does not exists in component '" + componentName + "' or its dependencies " + componentDependencies.stream().map(Component::getName).collect(joining(",")) + "."); } fragments.add(fragment); } bindings.addBinding(zoneName, fragments, entry.getMode()); } }