Strings { public static String toLowerCase(String str) { return str.toLowerCase(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 testLowerCase() { String s1 = "abc123-321BgC"; Assert.assertTrue(Strings.toLowerCase(s1).equals("abc123-321bgc")); String s2 = "SWITCH"; Assert.assertTrue( "Expected 'switch', got '" + Strings.toLowerCase(s2) + "'", Strings.toLowerCase(s2).equals("switch") ); Locale defaultLocale = Locale.getDefault(); try { Locale.setDefault(new Locale("tr")); Assert.assertTrue( "Expected 'switch', got '" + Strings.toLowerCase(s2) + "'", Strings.toLowerCase(s2).equals("switch") ); Assert.assertTrue( "Expected 'sw\u0131tch', got '" + s2.toLowerCase() + "'", s2.toLowerCase().equals("sw\u0131tch") ); } finally { Locale.setDefault(defaultLocale); } }