BooleanDifference implements IDifference { public static IDifference construct(String name, Boolean first, Boolean second) { if (Objects.equals(first, second)) { return null; } return new BooleanDifference(name, first, second); } private  BooleanDifference(String name, Boolean first, Boolean second); static IDifference construct(String name, Boolean first, Boolean second); @Override String toString();  }
@Test public void testDiff() { IDifference result = BooleanDifference.construct("Foo", true, false); Assert.assertNotNull(result); }
@Test public void testSame() { IDifference result = BooleanDifference.construct("Foo", false, false); Assert.assertNull(result); }
@Test public void testTwoNull() { IDifference result = BooleanDifference.construct("Foo", null, null); Assert.assertNull(result); }
@Test public void testOneNull() { IDifference result = BooleanDifference.construct("Foo", null, false); Assert.assertNotNull(result); result = BooleanDifference.construct("Foo", false, null); Assert.assertNotNull(result); }