MGraph graph = getEmptyMGraph();
BNode bNode = new BNode();
final UriRef HAS_NAME = new UriRef("http://example.org/ontology/hasName");
final PlainLiteralImpl name = new PlainLiteralImpl("http://example.org/people/alice");
final PlainLiteralImpl name2 = new PlainLiteralImpl("http://example.org/people/bob");
final Triple tripleAlice = new TripleImpl(bNode, HAS_NAME, name);
final Triple tripleBob = new TripleImpl(bNode, HAS_NAME, name2);
Assert.assertTrue(graph.add(tripleAlice));
Assert.assertTrue(graph.add(tripleBob));
Iterator<Triple> result = graph.filter(null, HAS_NAME, name);
Assert.assertEquals(bNode, result.next().getSubject());
}