### Question:
FieldValueFilter implements EntityProcessor { @Override public Representation process(Representation source) { if(includeAll && exclude.isEmpty()){ return source; } Iterator<Reference> refs = source.getReferences(field); if(!refs.hasNext()){ return (includeAll && !exclude.contains("")) || (!includeAll && included.contains("")) ? source : null; } while(refs.hasNext()){ String value = refs.next().getReference(); if((includeAll && !exclude.contains(value)) || (!includeAll && included.contains(value))){ return source; } } return null; } FieldValueFilter(); protected  FieldValueFilter(NamespacePrefixProvider nsPrefixProvider, String field, Object filterConfig); @Override Representation process(Representation source); @Override void close(); @Override void initialise(); @Override boolean needsInitialisation(); @Override void setConfiguration(Map<String,Object> config); static final String PARAM_FIELD; static final String PARAM_VALUES; static final String DEFAULT_FIELD; }### Answer:
@Test public void testIncludeConfig(){ EntityProcessor filter = new FieldValueFilter(nsPrefixProvider,"rdf:type","foaf:Person"); Representation r = getRepresentation(NamespaceEnum.foaf+"Person"); Assert.assertNotNull(filter.process(r)); r = getRepresentation(NamespaceEnum.skos+"Concept"); Assert.assertNull(filter.process(r)); r = getRepresentation(NamespaceEnum.skos+"Concept", NamespaceEnum.foaf+"Person"); Assert.assertNotNull(filter.process(r)); filter = new FieldValueFilter(nsPrefixProvider,"skos:releated",""); Assert.assertNotNull(filter.process(r)); filter = new FieldValueFilter(nsPrefixProvider,"skos:releated","null"); Assert.assertNotNull(filter.process(r)); filter = new FieldValueFilter(nsPrefixProvider,"skos:releated", null); Assert.assertNotNull(filter.process(r)); }
@Test public void testExcludeConfig(){ EntityProcessor filter = new FieldValueFilter(nsPrefixProvider,"rdf:type","*;!foaf:Person"); Representation r = getRepresentation(NamespaceEnum.foaf+"Person"); Assert.assertNull(filter.process(r)); r = getRepresentation(NamespaceEnum.skos+"Concept"); Assert.assertNotNull(filter.process(r)); r = getRepresentation(NamespaceEnum.skos+"Concept", NamespaceEnum.foaf+"Person"); Assert.assertNotNull(filter.process(r)); filter = new FieldValueFilter(nsPrefixProvider,"skos:releated","*;!null"); Assert.assertNull(filter.process(r)); filter = new FieldValueFilter(nsPrefixProvider,"skos:releated","*;!"); Assert.assertNull(filter.process(r)); filter = new FieldValueFilter(nsPrefixProvider,"skos:releated", "*;!;!foaf:Person"); Assert.assertNull(filter.process(r)); }