AtomTypeDiff { public static String diff(IChemObject first, IChemObject second) { IDifference difference = difference(first, second); if (difference == null) { return ""; } else { return difference.toString(); } } private  AtomTypeDiff(); static String diff(IChemObject first, IChemObject second); static IDifference difference(IChemObject first, IChemObject second);  }
@Test public void testMatchAgainstItself() { IAtomType element1 = mock(IAtomType.class); String result = AtomTypeDiff.diff(element1, element1); assertZeroLength(result); }
@Test public void testDiff() { IAtomType element1 = mock(IAtomType.class); IAtomType element2 = mock(IAtomType.class); when(element1.getHybridization()).thenReturn(PLANAR3); when(element2.getHybridization()).thenReturn(SP3); String result = AtomTypeDiff.diff(element1, element2); Assert.assertNotNull(result); Assert.assertNotSame(0, result.length()); assertContains(result, "AtomTypeDiff"); assertContains(result, "PLANAR3/SP3"); }