ElectronContainerDiff { public static String diff(IChemObject first, IChemObject second) { IDifference diff = difference(first, second); if (diff == null) { return ""; } else { return diff.toString(); } } private  ElectronContainerDiff(); static String diff(IChemObject first, IChemObject second); static IDifference difference(IChemObject first, IChemObject second);  }
@Test public void testMatchAgainstItself() { IElectronContainer atom1 = mock(IElectronContainer.class); String result = ElectronContainerDiff.diff(atom1, atom1); assertZeroLength(result); }
@Test public void testDiff() { IElectronContainer ec1 = mock(IElectronContainer.class); IElectronContainer ec2 = mock(IElectronContainer.class); when(ec1.getElectronCount()).thenReturn(2); when(ec2.getElectronCount()).thenReturn(3); String result = ElectronContainerDiff.diff(ec1, ec2); Assert.assertNotNull(result); Assert.assertNotSame(0, result.length()); assertContains(result, "ElectronContainerDiff"); assertContains(result, "eCount"); assertContains(result, "2/3"); }