AccumuloBoltUtils { public static String getEventRecordId(LogRecord record, String prefix, int splits) { String uuid = record.getUUID(); String shard = getShard(uuid.hashCode(), splits); long time = record.getDate().getTime(); return String.format("%s%s_%s_%s", prefix, shard, time, uuid); }  static String getEventRecordId(LogRecord record, String prefix, int splits); static String getShard(int hashcode, int splits); static final int SHARD_RADIX; }
@Test public void testGetEventRecordId(@Injectable LogRecord record, @Mocked Date date) { new Expectations() {{ record.getUUID(); result = "test"; date.getTime(); result = 1000000; }}; String result = getEventRecordId(record, "PREFIX_", 1); assertThat(result, is("PREFIX_0_1000000_test")); }