PropertyOperations implements PropertyLoader { public PropertyOperations filterValues(final Predicate<String> valuePredicate) { return new PropertyOperations(new FilteringPropertyLoader(propertyLoader, new BiPredicate<String, String>() { @Override public boolean test(String key, String value) { return valuePredicate.test(value); } })); } PropertyOperations(PropertyLoader propertyLoader); PropertyOperations filterKeys(final Predicate<String> keyPredicate); PropertyOperations filterValues(final Predicate<String> valuePredicate); PropertyOperations filterByKeyPrefix(final String keyPrefix); PropertyOperations filterKeysNotStartingWith(final String keyPrefix); PropertyOperations filter(final BiPredicate<String,String> keyAndValueFilter); PropertyOperations transformKeys(final Function<String,String> transform); PropertyOperations prefixKeys(final String prefix); PropertyOperations removeKeyPrefix(final String handlerPrefix); PropertyOperations filterByAndRemoveKeyPrefix(final String prefix); PropertyOperations transformValues(final Function<String,String> transform); PropertyOperations transform(final BiFunction<String,String,Tuple2<String,String>> transform); PropertyOperations merge(PropertyLoader p); PropertyOperations merge(PropertyOperations p); GroupedPropertyLoader group(BiFunction<String, String, Tuple3<String,String,String>> groupingFunction); GroupedPropertyLoader splitKeyAndGroup(final String keyDelimiter); Properties loadProperties(); Properties getProperties(); PropertyLoader getLoader(); static PropertyOperations properties(PropertyLoader propertyLoader); static PropertyOperations properties(final Properties properties); static PropertyOperations emptyProperties();  }
@Test public void testFilterValues() throws IOException { Properties p = properties(mockProperties()).filterValues(new Predicate<String>() { public boolean test(String v) { return (! v.equals("ValueA")); } }).loadProperties(); assertEquals(p, newProperties(tuple2("PropertyB", "ValueB"), tuple2("PropertyC", "ValueC"))); }