SimpleNamedGraph extends AbstractStatementSet implements NamedGraph { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o instanceof SimpleNamedGraph) { SimpleNamedGraph graph = (SimpleNamedGraph) o; if (!getGraphID().equals(graph.getGraphID())) return false; SesameModelWrapper model1 = new SesameModelWrapper(new org.eclipse.rdf4j.model.impl.LinkedHashModel()); model1.addAll(this); SesameModelWrapper model2 = new SesameModelWrapper(new org.eclipse.rdf4j.model.impl.LinkedHashModel()); model2.addAll(graph); return Models.isomorphic(model1.getSesameModel(), model2.getSesameModel()); } return false; } protected  SimpleNamedGraph(Resource graphID, ModelFactory factory);  SimpleNamedGraph();  SimpleNamedGraph(Resource graphID);  SimpleNamedGraph(Resource graphID, @Nonnull Model model);  SimpleNamedGraph(Resource graphID, @Nonnull Collection<@Nonnull ? extends Statement> c);  SimpleNamedGraph(Resource graphID, @Nonnull Set<@Nonnull Namespace> namespaces);  SimpleNamedGraph(Resource graphID, @Nonnull Set<@Nonnull Namespace> namespaces, @Nonnull Collection<@Nonnull ? extends Statement> c); @Override Resource getGraphID(); @Override boolean add(@Nonnull Resource subject, @Nonnull IRI predicate, @Nonnull Value object); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(@Nonnull Object o); @Override @Nonnull Iterator<Statement> iterator(); @Override boolean add(@Nonnull Statement statement); @Override boolean contains(Resource subject, IRI predicate, Value object); @Override Set<Resource> contexts(); @Override Set<Namespace> getNamespaces(); @Override Optional<Namespace> removeNamespace(@Nonnull String prefix); @Override void setNamespace(@Nonnull Namespace namespace); @Override Namespace setNamespace(@Nonnull String prefix, @Nonnull String name); @Override Model filter(Resource subject, IRI predicate, Value object); @Override boolean remove(Resource subject, IRI predicate, Value object); @Override NamedGraph unmodifiable(); @Override Model asModel(); @Override Model asModel(@Nonnull ModelFactory factory); @Override boolean remove(@Nonnull Object o); @Override void clear(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testEquals() { IRI s = new SimpleIRI("http: IRI p = new SimpleIRI("http: IRI o = new SimpleIRI("http: Literal o2 = new SimpleLiteral("Mobi"); BNode b = new SimpleBNode("_:mobi1"); BNode b2 = new SimpleBNode("_:mobi2"); SimpleNamedGraph graph1 = new SimpleNamedGraph(new SimpleIRI("http: SimpleNamedGraph graph2 = new SimpleNamedGraph(new SimpleIRI("http: SimpleNamedGraph graph3 = new SimpleNamedGraph(new SimpleIRI("http: SimpleNamedGraph graph4 = new SimpleNamedGraph(new SimpleIRI("http: SimpleNamedGraph graph5 = new SimpleNamedGraph(new SimpleIRI("http: SimpleNamedGraph graph6 = new SimpleNamedGraph(new SimpleIRI("http: SimpleNamedGraph graph7 = new SimpleNamedGraph(new SimpleIRI("http: graph1.add(s, p, o); graph2.add(s, p, o); graph4.add(s, p, o); graph4.add(s, p, b); graph4.add(b, p, o2); graph5.add(s, p, o); graph5.add(s, p, b); graph5.add(b, p, o2); graph6.add(s, p, b); graph6.add(b, p, o2); graph7.add(s, p, b2); graph7.add(b2, p, o2); assertEquals(graph1, graph2); assertEquals(graph4, graph5); assertNotEquals(graph1, graph3); assertEquals(graph6, graph7); }