### Question:
Utils { public static int toIntHex(String num, int defaultValue) { if (num != null && !num.contains(" ")) { if (num.startsWith("#")) { num = num.substring(1); } try (Scanner scanner = new Scanner(num)) { if (scanner.hasNextInt()) { return Integer.parseInt(num, 16); } } } return defaultValue; } private  Utils(); static String readFile(File file, String charsetName); static String readStream(InputStream is, String charsetName); static void delete(File file); static int toInt(String num, int defaultValue); static int toIntHex(String num, int defaultValue); static long toLong(String num, long defaultValue); static long toLong(Long num, long defaultValue); static float toFloat(String num, float defaultValue); static String getJspEncoding(InputStream is); static void sendFile(HttpServletRequest request, HttpServletResponse response, File file); static Thread getThreadByName(String name); static String highlightStream(String name, InputStream input, String rendererName,
      String encoding); static void sendCompressedFile(HttpServletResponse response, File file); static List<String> getNamesForLocale(String baseName, Locale locale); static boolean isThreadingEnabled();  }### Answer:
@Test public void toIntHexTest() { Assertions.assertEquals(5, Utils.toIntHex("garbage", 5)); Assertions.assertEquals(3, Utils.toIntHex("3", 5)); Assertions.assertEquals(3, Utils.toIntHex("#3", 5)); Assertions.assertEquals(5, Utils.toIntHex("3 3", 5)); Assertions.assertEquals(5, Utils.toIntHex((String) null, 5)); }