### Question:
Util { public static int fromString(String s) throws IllegalArgumentException { char[] ca = s.toCharArray(); if (ca.length != 4) { throw new IllegalArgumentException(); } int res = 0; for (int i = 0; i < 4; i++) { int c = ca[i]; if (c > 0xff) { throw new IllegalArgumentException(); } res |= (c << ((3 - i) * 8)); } return res; }  static void assertEquals(String expected, String actual); static String toString(int tag); static int fromString(String s); static String pidToString(byte[] libraryPersistentId); static String toUrl(String p); static boolean isIdentifier(String id);  }### Answer:
@Test public void testFromString() throws UnsupportedEncodingException { String s = "hdfm"; assertEquals(1751410285, Util.fromString(s)); }
@Test(expected = IllegalArgumentException.class) public void failsWithBadIdStringLength() { Util.fromString(""); }
@Test(expected = IllegalArgumentException.class) public void failsWithBadIdStringCharacters() { Util.fromString("€€€€"); }