### Question:
IOUtils { public static String getResourceAsString(String path, int maxLen) throws IOException { ParamChecker.notEmpty(path, "path"); InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(path); if (is == null) { throw new IllegalArgumentException(XLog.format("resource [{0}] not found", path)); } Reader reader = new InputStreamReader(is, StandardCharsets.UTF_8); return getReaderAsString(reader, maxLen); }  static void delete(File file); static String getReaderAsString(Reader reader, int maxLen); static InputStream getResourceAsStream(String path, int maxLen); static Reader getResourceAsReader(String path, int maxLen); static String getResourceAsString(String path, int maxLen); static void copyStream(InputStream is, OutputStream os); static void copyCharStream(Reader reader, Writer writer); static void zipDir(File dir, String relativePath, ZipOutputStream zos); static File createJar(File baseDir, String jarName, Class... classes); static void closeSafely(Closeable... objects);  }### Answer:
@Test public void testGetResourceAsString() throws IOException { try { IOUtils.getResourceAsString("invalid-resource.txt", 2); fail(); } catch (IllegalArgumentException ex) { } String s = IOUtils.getResourceAsString("test-ioutils.txt", 10); assertEquals("abcde", s); try { IOUtils.getResourceAsString("test-ioutils.txt", 2); fail(); } catch (IllegalArgumentException ex) { } }