ShortURL { public static String generate() { StringBuilder builder = new StringBuilder(); for (int i = 0; i < 12; i++) { builder.append(ALPHABET.charAt(RANDOM.nextInt(ALPHABET.length()))); } return builder.toString(); }  static String generate();  }
@Test public void shouldGenerateAnIdOfLength12() throws Exception { final String shortUrl = ShortURL.generate(); assertThat(shortUrl.length(), is(12)); }