### Question:
MessageIdGenerator { public String getNextId() { while (generatedIds.size() == 0); synchronized (generatedIds) { return generatedIds.poll(); } } MessageIdGenerator(); synchronized String generate(long time); String getNextId();  }### Answer:
@Test public void testGetNextId() { assertNotNull("Next Id", messageIdGenerator.getNextId()); assertFalse(messageIdGenerator.getNextId().contains("?")); }