@Test public void sortPropertyFilter() { DefaultConfigurationBuilder b = new DefaultConfigurationBuilder(); PropertyFilter[] propertyFilters = new PropertyFilter[10]; for (int i = 0; i < propertyFilters.length; i++) { propertyFilters[i] = (value, ctx) -> value.setValue(toString() + " - "); } b.addPropertyFilters(propertyFilters); Comparator<PropertyFilter> pfComp = (o1, o2) -> o1.toString().compareTo(o2.toString()); assertThat(b.sortPropertyFilter(pfComp).getClass()).isEqualTo(DefaultConfigurationBuilder.class); Arrays.sort(propertyFilters, pfComp); for (int i = 0; i < propertyFilters.length; i++) { assertThat(b.getPropertyFilters().get(i)).isEqualTo(propertyFilters[i]); } }
@Override public ConfigurationBuilder sortPropertyFilter(Comparator<PropertyFilter> comparator) { Collections.sort(propertyFilters, comparator); return this; }
DefaultConfigurationBuilder implements ConfigurationBuilder { @Override public ConfigurationBuilder sortPropertyFilter(Comparator<PropertyFilter> comparator) { Collections.sort(propertyFilters, comparator); return this; } }
DefaultConfigurationBuilder implements ConfigurationBuilder { @Override public ConfigurationBuilder sortPropertyFilter(Comparator<PropertyFilter> comparator) { Collections.sort(propertyFilters, comparator); return this; } DefaultConfigurationBuilder();  DefaultConfigurationBuilder(ConfigurationContext context);  DefaultConfigurationBuilder(Configuration configuration); }
DefaultConfigurationBuilder implements ConfigurationBuilder { @Override public ConfigurationBuilder sortPropertyFilter(Comparator<PropertyFilter> comparator) { Collections.sort(propertyFilters, comparator); return this; } DefaultConfigurationBuilder();  DefaultConfigurationBuilder(ConfigurationContext context);  DefaultConfigurationBuilder(Configuration configuration); @Override ConfigurationBuilder setClassLoader(ClassLoader classLoader); @Override ClassLoader getClassLoader(); @Override ConfigurationBuilder setServiceContext(ServiceContext serviceContext); ConfigurationBuilder setConfiguration(Configuration configuration); @Override ConfigurationBuilder setContext(ConfigurationContext context); @Override ConfigurationBuilder setMeta(String property, String key, String value); @Override ConfigurationBuilder setMeta(String property, Map<String, String> metaData); @Override ConfigurationBuilder addPropertySources(Collection<PropertySource> sources); ConfigurationBuilder addDefaultPropertyFilters(); ConfigurationBuilder addDefaultPropertySources(); ConfigurationBuilder addDefaultPropertyConverters(); @Override ConfigurationBuilder removePropertySources(Collection<PropertySource> propertySources); @Override List<PropertySource> getPropertySources(); @Override ConfigurationBuilder increasePriority(PropertySource propertySource); @Override ConfigurationBuilder decreasePriority(PropertySource propertySource); @Override ConfigurationBuilder highestPriority(PropertySource propertySource); @Override ConfigurationBuilder lowestPriority(PropertySource propertySource); @Override ConfigurationBuilder addPropertyFilters(Collection<PropertyFilter> filters); @Override ConfigurationBuilder removePropertyFilters(Collection<PropertyFilter> filters); @Override ConfigurationBuilder removePropertyConverters(TypeLiteral<T> typeToConvert,
                                                                    Collection<PropertyConverter<T>> converters); @Override ConfigurationBuilder removePropertyConverters(TypeLiteral<?> typeToConvert); @Override ConfigurationBuilder addPropertyConverters(TypeLiteral<T> type, Collection<PropertyConverter<T>> propertyConverters); @Override Configuration build(); @Override ConfigurationBuilder sortPropertyFilter(Comparator<PropertyFilter> comparator); @Override ConfigurationBuilder sortPropertySources(Comparator<PropertySource> comparator); @Override ConfigurationBuilder sortPropertyConverter(Comparator<PropertyConverter> comparator); @Override List<PropertyFilter> getPropertyFilters(); @Override Map<TypeLiteral<?>, List<PropertyConverter<?>>> getPropertyConverter(); }
DefaultConfigurationBuilder implements ConfigurationBuilder { @Override public ConfigurationBuilder sortPropertyFilter(Comparator<PropertyFilter> comparator) { Collections.sort(propertyFilters, comparator); return this; } DefaultConfigurationBuilder();  DefaultConfigurationBuilder(ConfigurationContext context);  DefaultConfigurationBuilder(Configuration configuration); @Override ConfigurationBuilder setClassLoader(ClassLoader classLoader); @Override ClassLoader getClassLoader(); @Override ConfigurationBuilder setServiceContext(ServiceContext serviceContext); ConfigurationBuilder setConfiguration(Configuration configuration); @Override ConfigurationBuilder setContext(ConfigurationContext context); @Override ConfigurationBuilder setMeta(String property, String key, String value); @Override ConfigurationBuilder setMeta(String property, Map<String, String> metaData); @Override ConfigurationBuilder addPropertySources(Collection<PropertySource> sources); ConfigurationBuilder addDefaultPropertyFilters(); ConfigurationBuilder addDefaultPropertySources(); ConfigurationBuilder addDefaultPropertyConverters(); @Override ConfigurationBuilder removePropertySources(Collection<PropertySource> propertySources); @Override List<PropertySource> getPropertySources(); @Override ConfigurationBuilder increasePriority(PropertySource propertySource); @Override ConfigurationBuilder decreasePriority(PropertySource propertySource); @Override ConfigurationBuilder highestPriority(PropertySource propertySource); @Override ConfigurationBuilder lowestPriority(PropertySource propertySource); @Override ConfigurationBuilder addPropertyFilters(Collection<PropertyFilter> filters); @Override ConfigurationBuilder removePropertyFilters(Collection<PropertyFilter> filters); @Override ConfigurationBuilder removePropertyConverters(TypeLiteral<T> typeToConvert,
                                                                    Collection<PropertyConverter<T>> converters); @Override ConfigurationBuilder removePropertyConverters(TypeLiteral<?> typeToConvert); @Override ConfigurationBuilder addPropertyConverters(TypeLiteral<T> type, Collection<PropertyConverter<T>> propertyConverters); @Override Configuration build(); @Override ConfigurationBuilder sortPropertyFilter(Comparator<PropertyFilter> comparator); @Override ConfigurationBuilder sortPropertySources(Comparator<PropertySource> comparator); @Override ConfigurationBuilder sortPropertyConverter(Comparator<PropertyConverter> comparator); @Override List<PropertyFilter> getPropertyFilters(); @Override Map<TypeLiteral<?>, List<PropertyConverter<?>>> getPropertyConverter();  }