### Question:
Hex { public static int fromString (String s) { if ( s.length() != 2 ) return 0; int b = 0; b = (Character.digit(s.charAt(0), 16) << 4) + (Character.digit(s.charAt(1), 16)); return b; }  static int fromString(String s); static byte[] fromHexString(String s); static String toPrint(byte[] bytes); static String toPrint(byte[] bytes, int offset, int length); static String toString(byte[] bytes); static String toString(byte[] bytes,int offset, int length);  }### Answer:
@Test public void testOneByte() { String str = "FF"; byte b = (byte) Hex.fromString(str); assertTrue(b == (byte) 0xFF); }