### Question:
MessageIdGenerator { public synchronized String generate(long time) { if (lastTime == time) { sequence--; } else { lastTime = time; sequence = MAX_SEQUENCE; } return toBase58(time) + toBase58(sequence); } MessageIdGenerator(); synchronized String generate(long time); String getNextId();  }### Answer:
@Test public void testGenerate() { try { assertNotNull("Message Id not null", messageIdGenerator.generate(currentTimeMillis())); PowerMockito.verifyPrivate(messageIdGenerator, times(2)) .invoke("toBase58", anyLong()); } catch (Exception e) { fail("This should not happen"); } }