### Question:
Now { public static Now getInstance() { if (instance == null) { synchronized (Now.class) { if (instance == null) { instance = new Now(false); } } } return instance; } Now(); private  Now(boolean delegate); static Now getInstance(); long get(); @Override boolean equals(Object o2); @Override int hashCode();  }### Answer:
@Test public void testSingleton() { Now now = Now.getInstance(); Now now2 = Now.getInstance(); Assert.assertSame(now, now2); }
@Test public void testDelegate() { Now now = Now.getInstance(); Now now2 = new Now(); Assert.assertEquals(now, now2); }
@Test public void testDelegate3() { Now now = new Now(); Now now2 = Now.getInstance(); Assert.assertEquals(now, now2); }