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