ImplicitToExplicit extends AbstractFunction<Graph,Graph> { static Bond type(Atom u, Atom v) { return u.aromatic() && v.aromatic() ? Bond.AROMATIC : Bond.SINGLE; }  Graph apply(final Graph g);  }
@Test public void aromaticType() { Atom a = Mockito.mock(Atom.class); Atom b = Mockito.mock(Atom.class); Mockito.when(a.aromatic()).thenReturn(true); Mockito.when(b.aromatic()).thenReturn(true); Assert.assertThat(ImplicitToExplicit.type(a, b), CoreMatchers .is(Bond.AROMATIC)); }
@Test public void singleType() { Atom a = Mockito.mock(Atom.class); Atom b = Mockito.mock(Atom.class); Mockito.when(a.aromatic()).thenReturn(true); Mockito.when(b.aromatic()).thenReturn(false); Assert.assertThat(ImplicitToExplicit.type(a, b), CoreMatchers .is(Bond.SINGLE)); Mockito.when(a.aromatic()).thenReturn(false); Mockito.when(b.aromatic()).thenReturn(true); Assert.assertThat(ImplicitToExplicit.type(a, b), CoreMatchers .is(Bond.SINGLE)); Mockito.when(a.aromatic()).thenReturn(false); Mockito.when(b.aromatic()).thenReturn(false); Assert.assertThat(ImplicitToExplicit.type(a, b), CoreMatchers .is(Bond.SINGLE)); }