ExclusiveFieldFilter implements FieldFilter, Serializable { @Override public boolean allowField(String fieldName) { return !(fieldName.startsWith("_") || excludeFields.contains(fieldName)); } ExclusiveFieldFilter(Collection<String> excludeFields); @Override boolean allowField(String fieldName);  }
@Test public void testAllowField() { final ExclusiveFieldFilter instance = new ExclusiveFieldFilter(Arrays.asList("exclude 1", "exclude 2")); assertFalse(instance.allowField("exclude 1")); assertFalse(instance.allowField("exclude 2")); assertFalse(instance.allowField("_other")); assertTrue(instance.allowField("other")); }