SimpleIdGenerator extends PlainIdGenerator { @Override public String create(Object msg) { return host + getSeparator() + (msg == null ? "0" : Integer.toHexString(msg.hashCode())) + getSeparator() + System.currentTimeMillis(); } SimpleIdGenerator();  SimpleIdGenerator(String separator); @Override String create(Object msg);  }
@Test public void testCreateId() throws Exception { IdGenerator guid = new SimpleIdGenerator(); assertNotNull(guid.create(guid)); }
@Test public void testCreateIdWithNull() throws Exception { IdGenerator guid = new SimpleIdGenerator(); assertNotNull(guid.create(null)); }
@Test public void testSeparator() throws Exception { SimpleIdGenerator guid = new SimpleIdGenerator("-"); assertEquals("-", guid.getSeparator()); assertNotNull(guid.create(guid)); assertTrue(guid.create(guid).contains("-")); }