### Question:
UidGenerator { public synchronized long getNegativeUid() { return --lastId; } private  UidGenerator(); static UidGenerator getInstance(); synchronized long getApplicationWideUid(); synchronized long getNextNegativeUid(); synchronized long getNextUidForSession(String sessionId); synchronized long getNegativeUid();  }### Answer:
@Test public void testGetNegativeUid() { long uid1 = UidGenerator.getInstance().getNegativeUid(); long uid2 = UidGenerator.getInstance().getNegativeUid(); assertTrue("uid is negative:" + uid1, uid1 < 0); assertTrue("uid min test: " + uid1, uid1 > Integer.MIN_VALUE); assertTrue("uid max test:" + uid1, uid1 < Integer.MAX_VALUE); assertTrue("uid is negative:" + uid2, uid2 < 0); assertTrue("uid min test: " + uid2, uid2 > Integer.MIN_VALUE); assertTrue("uid max test:" + uid2, uid2 < Integer.MAX_VALUE); assertNotSame("ID must be unique", uid1, uid2); }