DefaultRunIdGenerator implements RunidGenerator { @Override public String generateRunid() { StringBuilder sb = new StringBuilder(length); Random random = new Random(); for(int i=0;i<length;i++){ int index = random.nextInt(16); sb.append(hex[index]); } return sb.toString(); }  @Override String generateRunid();  }
@Test public void testGenerate(){ Set<String> ids = new HashSet<>(); DefaultRunIdGenerator defaultRunIdGenerator = new DefaultRunIdGenerator(); for(int i=0;i<count;i++){ ids.add(defaultRunIdGenerator.generateRunid()); } Assert.assertEquals(count, ids.size()); }