### Question:
TombstonePropertySelector extends SimpleSelector { @Override public boolean selects(Statement s) { return (subject == null || s.getSubject().equals(subject)) && (permittedPredicates.contains(s.getPredicate())); } TombstonePropertySelector(Resource subject);  TombstonePropertySelector(); @Override boolean selects(Statement s);  }### Answer:
@Test public void testPermittedPropertyAnySubject() { TombstonePropertySelector selector = new TombstonePropertySelector(); Statement s = ResourceFactory.createStatement(ResourceFactory.createResource(), DcElements.title, ResourceFactory.createPlainLiteral("title")); assertTrue(selector.selects(s)); }
@Test public void testPermittedPropertySpecificSubject() { Resource resc = ResourceFactory.createResource(); TombstonePropertySelector selector = new TombstonePropertySelector(resc); Statement s1 = ResourceFactory.createStatement(resc, DcElements.title, ResourceFactory.createPlainLiteral("title")); assertTrue(selector.selects(s1)); Resource unrelatedResc = ResourceFactory.createResource(); Statement s2 = ResourceFactory.createStatement(unrelatedResc, DcElements.title, ResourceFactory.createPlainLiteral("title")); assertFalse(selector.selects(s2)); }
@Test public void testPropertyNotPermittedAnySubject() { TombstonePropertySelector selector = new TombstonePropertySelector(); Statement s = ResourceFactory.createStatement(ResourceFactory.createResource(), Ebucore.privateTelephoneNumber, ResourceFactory.createPlainLiteral("800-FOR-BOXY")); assertFalse(selector.selects(s)); }
@Test public void testPropertyNotPermittedSpecificSubject() { Resource resc = ResourceFactory.createResource(); TombstonePropertySelector selector = new TombstonePropertySelector(resc); Statement s = ResourceFactory.createStatement(resc, Ebucore.privateTelephoneNumber, ResourceFactory.createPlainLiteral("800-FOR-BOXY")); assertFalse(selector.selects(s)); }