BondOrderDifference implements IDifference { public static IDifference construct(String name, IBond.Order first, IBond.Order second) { if (first == second) { return null; } return new BondOrderDifference(name, first, second); } private  BondOrderDifference(String name, IBond.Order first, IBond.Order second); static IDifference construct(String name, IBond.Order first, IBond.Order second); @Override String toString();  }
@Test public void testDiff() { IDifference result = BondOrderDifference.construct("Foo", IBond.Order.SINGLE, IBond.Order.DOUBLE); Assert.assertNotNull(result); }
@Test public void testSame() { IDifference result = BondOrderDifference.construct("Foo", IBond.Order.SINGLE, IBond.Order.SINGLE); Assert.assertNull(result); }
@Test public void testTwoNull() { IDifference result = BondOrderDifference.construct("Foo", null, null); Assert.assertNull(result); }
@Test public void testOneNull() { IDifference result = BondOrderDifference.construct("Foo", null, IBond.Order.SINGLE); Assert.assertNotNull(result); result = BondOrderDifference.construct("Foo", IBond.Order.SINGLE, null); Assert.assertNotNull(result); }