### Question:
GraphTrimmer extends GraphProcessor { <M extends Message<M>> Result<M, Failure> trim(final M message) { return message.body(rdf()).value(rdf -> message.body(rdf(), trim(iri(message.item()), convey(message.shape()), rdf) )); }    }### Answer:
@Test void testRetainCompatibleStatements() { exec(() -> assertThat(trim(field(RDF.FIRST, field(RDF.REST)), decode("<> rdf:first [rdf:rest rdf:nil]."))) .hasSubset(decode("<> rdf:first [rdf:rest rdf:nil].")) ); }
@Test void testRemoveIncompatibleStatements() { exec(() -> assertThat(trim(field(RDF.FIRST), decode("<> rdf:rest rdf:nil."))) .isEmpty() ); }
@Test void testRemoveDisconnectedStatements() { exec(() -> assertThat(trim(field(RDF.FIRST), decode("rdf:nil rdf:value rdf:nil."))) .isEmpty() ); }