### Question:
IdUtils { public static String makeID(String bizCode) { if (StringUtils.isBlank(bizCode) || bizCode.length() < 2 || bizCode.length() > 8) { throw new RuntimeException(Info.get(IdUtils.class, R.ID_FAILED1, bizCode)); } StringBuilder buf = new StringBuilder(32); buf.append(bizCode, 0, bizCode.length()) .append(DateFormatUtils.format(System.currentTimeMillis(), "yyyyMMddHHmmssSSS")) .append(RandomStringUtils.randomAlphabetic(15 - bizCode.length()).toLowerCase()); return buf.toString(); }  static String makeUUID(); static String makeID(String bizCode); static String makeID(String bizCode, String serverId); static String makeSn(); static String makeSnRandom();  }### Answer:
@Test public void testMakeSwiftIdByCode() { String s = IdUtils.makeID("teusrore"); System.out.println(s); Assertions.assertEquals(32, s.length()); System.out.println(IdUtils.makeID("basedocu")); System.out.println(IdUtils.makeID("basident")); System.out.println(IdUtils.makeID("poipicfi")); System.out.println(IdUtils.makeID("poiaudfi")); System.out.println(IdUtils.makeID("poscadfi")); }
@Test public void testMakeSwiftIdByCodeFail() { String s = IdUtils.makeID("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); }
@Test public void testMakeSwiftIdByCodeAndServerId() { String s = IdUtils.makeID("adcdef", "1234"); System.out.println(s); Assertions.assertEquals(32, s.length()); s = IdUtils.makeID("abcdef", "1234"); System.out.println(s); Assertions.assertEquals(32, s.length()); s = IdUtils.makeID("abcd", "1234"); System.out.println(s); Assertions.assertEquals(32, s.length()); s = IdUtils.makeID("abcdef", "12"); System.out.println(s); Assertions.assertEquals(32, s.length()); s = IdUtils.makeID("abcdef", "123"); System.out.println(s); Assertions.assertEquals(32, s.length()); }
@Test public void testMakePerformance() { long start = System.currentTimeMillis(); for (int i = 0; i < 1000; i++) { String s = IdUtils.makeID("abba", "12"); System.out.println(s); } long end = System.currentTimeMillis(); System.out.println("生成时间：" + (end - start)); System.out.println("平均生成时间：" + new BigDecimal(end - start).divide(new BigDecimal(1000))); }