@Test public void toExplicitEdge_NonImplicitIdentity() { Graph g = new Graph(0); for (Bond b : Bond.values()) { if (b != IMPLICIT) { Edge e = new Edge(0, 1, SINGLE); Assert.assertThat(ImplicitToExplicit .toExplicitEdge(g, e), CoreMatchers .is(CoreMatchers.sameInstance(e))); } } }
static Edge toExplicitEdge(final Graph g, final Edge e) { final int u = e.either(), v = e.other(u); if (e.bond() == Bond.IMPLICIT) { return new Edge(u, v, type(g.atom(u), g.atom(v))); } return e; }
ImplicitToExplicit extends AbstractFunction<Graph,Graph> { static Edge toExplicitEdge(final Graph g, final Edge e) { final int u = e.either(), v = e.other(u); if (e.bond() == Bond.IMPLICIT) { return new Edge(u, v, type(g.atom(u), g.atom(v))); } return e; } }
ImplicitToExplicit extends AbstractFunction<Graph,Graph> { static Edge toExplicitEdge(final Graph g, final Edge e) { final int u = e.either(), v = e.other(u); if (e.bond() == Bond.IMPLICIT) { return new Edge(u, v, type(g.atom(u), g.atom(v))); } return e; }  }
ImplicitToExplicit extends AbstractFunction<Graph,Graph> { static Edge toExplicitEdge(final Graph g, final Edge e) { final int u = e.either(), v = e.other(u); if (e.bond() == Bond.IMPLICIT) { return new Edge(u, v, type(g.atom(u), g.atom(v))); } return e; }  Graph apply(final Graph g); }
ImplicitToExplicit extends AbstractFunction<Graph,Graph> { static Edge toExplicitEdge(final Graph g, final Edge e) { final int u = e.either(), v = e.other(u); if (e.bond() == Bond.IMPLICIT) { return new Edge(u, v, type(g.atom(u), g.atom(v))); } return e; }  Graph apply(final Graph g);  }