### Question:
BrowserBuilder { static URL findLocalizedResourceURL(String resource, Locale l, IOException[] mal, Class<?> relativeTo) { URL url = null; if (l != null) { url = findResourceURL(resource, "_" + l.getLanguage() + "_" + l.getCountry(), mal, relativeTo); if (url != null) { return url; } url = findResourceURL(resource, "_" + l.getLanguage(), mal, relativeTo); } if (url != null) { return url; } return findResourceURL(resource, null, mal, relativeTo); } private  BrowserBuilder(Object[] context); static BrowserBuilder newBrowser(Object... context); BrowserBuilder loadClass(Class<?> mainClass); BrowserBuilder loadFinished(Runnable r); BrowserBuilder loadPage(String page); BrowserBuilder locale(Locale locale); BrowserBuilder invoke(String methodName, String... args); BrowserBuilder classloader(ClassLoader l); void showAndWait();  }### Answer:
@Test public void findsZhCN() throws IOException { File zh = new File(dir, "index_zh.html"); zh.createNewFile(); File zhCN = new File(dir, "index_zh_CN.html"); zhCN.createNewFile(); IOException[] mal = { null }; URL url = BrowserBuilder.findLocalizedResourceURL("index.html", Locale.SIMPLIFIED_CHINESE, mal, BrowserBuilder.class); assertEquals(url, zhCN.toURI().toURL(), "Found both suffixes"); }
@Test public void findsZh() throws IOException { File zh = new File(dir, "index_zh.html"); zh.createNewFile(); IOException[] mal = { null }; URL url = BrowserBuilder.findLocalizedResourceURL("index.html", Locale.SIMPLIFIED_CHINESE, mal, BrowserBuilder.class); assertEquals(url, zh.toURI().toURL(), "Found one suffix"); }
@Test public void findsIndex() throws IOException { IOException[] mal = { null }; URL url = BrowserBuilder.findLocalizedResourceURL("index.html", Locale.SIMPLIFIED_CHINESE, mal, BrowserBuilder.class); assertEquals(url, index.toURI().toURL(), "Found root file"); }