Strings { public static String toUpperCase(String str) { return str.toUpperCase(Locale.ENGLISH); } private  Strings(); static String byteToUnsignedHexString(byte b); static String bytesToHex(byte[] bytes); static String toUpperCase(String str); static String toLowerCase(String str); static int convertPollingIntervalString(String pollingInterval);  }
@Test public void testUpperCase() { String s1 = "abc123-321BgC"; Assert.assertTrue(Strings.toUpperCase(s1).equals("ABC123-321BGC")); String s2 = "switch"; Assert.assertTrue( "Expected 'SWITCH', got '" + Strings.toUpperCase(s2) + "'", Strings.toUpperCase(s2).equals("SWITCH") ); Locale defaultLocale = Locale.getDefault(); try { Locale.setDefault(new Locale("tr")); Assert.assertTrue( "Expected 'SWITCH', got '" + Strings.toUpperCase(s2) + "'", Strings.toUpperCase(s2).equals("SWITCH") ); Assert.assertTrue( "Expected 'SW\u0130TCH', got '" + s2.toUpperCase() + "'", s2.toUpperCase().equals("SW\u0130TCH") ); } finally { Locale.setDefault(defaultLocale); } }