Locale { @Pure public static String getStringWithDefault(Class<?> resource, String key, String defaultValue, Object... params) { return getStringWithDefault(ClassLoaderFinder.findClassLoader(), detectResourceClass(resource), key, defaultValue, params); } private  Locale(); static Charset[] getPriorizedDecodingCharsets(); static void setPriorizedDecodingCharsets(Charset[] charsets); @Pure @Inline(value = "Locale.getStringWithDefaultFrom(ClassLoaderFinder.findClassLoader(), ($1), ($2), ($3), ($4))", imported = {Locale.class, ClassLoaderFinder.class}) static String getStringWithDefaultFrom(String resourcePath, String key, String defaultValue, Object... params); @Pure static String getStringWithDefaultFrom(ClassLoader classLoader, String resourcePath, String key,
			String defaultValue, Object... params); @Pure @Inline(value = "Locale.getStringWithDefaultFrom(($1), ($2), ($3), ($4))", imported = {Locale.class}) static String getStringFrom(String resourcePath, String key, Object... params); @Pure @Inline(value = "Locale.getStringWithDefaultFrom(($1), ($2), ($3), ($3), ($4))", imported = {Locale.class}) static String getStringFrom(ClassLoader classLoader, String resourcePath, String key, Object... params); @Pure static String getString(Class<?> resource, String key, Object... params); @Pure static String getString(ClassLoader classLoader, Class<?> resource, String key, Object... params); static String getString(String key, Object... params); @Pure static String getString(ClassLoader classLoader, String key, Object... params); @Pure static String getStringWithDefault(Class<?> resource, String key, String defaultValue, Object... params); @Pure static String getStringWithDefault(ClassLoader classLoader, Class<?> resource, String key,
			String defaultValue, Object... params); @Pure static String getStringWithDefault(String key, String defaultValue, Object... params); @Pure static String getStringWithDefault(ClassLoader classLoader, String key, String defaultValue, Object... params); @Pure static String decodeString(byte[] bytes); static String decodeString(InputStream stream); static boolean decodeString(InputStream stream, List<String> lineArray);  }
@Test public void getStringWithDefaultClassStringStringStringArray() { assertEquals( DEFAULT, Locale.getStringWithDefault(LocaleTest.class,NOKEY,DEFAULT,P1,P2,P3)); assertEquals( "ABC P1 'P2' {2}", Locale.getStringWithDefault(LocaleTest.class,KEY1,DEFAULT,P1,P2,P3)); assertEquals( "ABC P3 'P1' {2}", Locale.getStringWithDefault(LocaleTest.class,KEY1,DEFAULT,P3,P1,P2)); assertEquals( DEFAULT, Locale.getStringWithDefault(LocaleStub.class,NOKEY,DEFAULT,P1,P2,P3)); assertEquals( "DEF P1 'P2' {2}", Locale.getStringWithDefault(LocaleStub.class,KEY1,DEFAULT,P1,P2,P3)); assertEquals( "DEF P3 'P1' {2}", Locale.getStringWithDefault(LocaleStub.class,KEY1,DEFAULT,P3,P1,P2)); }
@Test public void getStringWithDefaultClassLoaderClassStringStringStringArray() { ClassLoader l = LocaleTest.class.getClassLoader(); assertEquals( DEFAULT, Locale.getStringWithDefault(l, LocaleTest.class,NOKEY,DEFAULT,P1,P2,P3)); assertEquals( "ABC P1 'P2' {2}", Locale.getStringWithDefault(l, LocaleTest.class,KEY1,DEFAULT,P1,P2,P3)); assertEquals( "ABC P3 'P1' {2}", Locale.getStringWithDefault(l, LocaleTest.class,KEY1,DEFAULT,P3,P1,P2)); assertEquals( DEFAULT, Locale.getStringWithDefault(l, LocaleStub.class,NOKEY,DEFAULT,P1,P2,P3)); assertEquals( "DEF P1 'P2' {2}", Locale.getStringWithDefault(l, LocaleStub.class,KEY1,DEFAULT,P1,P2,P3)); assertEquals( "DEF P3 'P1' {2}", Locale.getStringWithDefault(l, LocaleStub.class,KEY1,DEFAULT,P3,P1,P2)); }
@Test public void getStringWithDefaultStringStringStringArray() { assertEquals( DEFAULT, Locale.getStringWithDefault(NOKEY,DEFAULT,P1,P2,P3)); assertEquals( "ABC P1 'P2' {2}", Locale.getStringWithDefault(KEY1,DEFAULT,P1,P2,P3)); assertEquals( "ABC P3 'P1' {2}", Locale.getStringWithDefault(KEY1,DEFAULT,P3,P1,P2)); try { Locale.getStringWithDefault(KEY2,DEFAULT); fail("expecting IllegalArgumentException"); } catch(IllegalArgumentException exception) { } assertEquals( "(d92b87b0-efe9-4dd9-903f-7c994b8e2a9f)", Locale.getStringWithDefault(KEY3,DEFAULT)); }
@Test public void getStringWithDefaultClassLoaderStringStringStringArray() { ClassLoader l = LocaleTest.class.getClassLoader(); assertEquals( DEFAULT, Locale.getStringWithDefault(l, NOKEY,DEFAULT,P1,P2,P3)); assertEquals( "ABC P1 'P2' {2}", Locale.getStringWithDefault(l, KEY1,DEFAULT,P1,P2,P3)); assertEquals( "ABC P3 'P1' {2}", Locale.getStringWithDefault(l, KEY1,DEFAULT,P3,P1,P2)); try { Locale.getStringWithDefault(l, KEY2, DEFAULT); fail("expecting IllegalArgumentException"); } catch(IllegalArgumentException exception) { } assertEquals( "(d92b87b0-efe9-4dd9-903f-7c994b8e2a9f)", Locale.getStringWithDefault(l, KEY3, DEFAULT)); }