IntrospectorUtils { public static String decapitalize(String name) { if ( name == null || name.length() == 0 ) { return name; } if ( name.length() > 1 && Character.isUpperCase( name.charAt( 1 ) ) && Character.isUpperCase( name.charAt( 0 ) ) ) { return name; } char[] chars = name.toCharArray(); chars[0] = Character.toLowerCase( chars[0] ); return new String( chars ); } private  IntrospectorUtils(); static String decapitalize(String name);  }
@Test public void testDecapitalize() { assertThat( IntrospectorUtils.decapitalize( null ) ).isNull(); assertThat( IntrospectorUtils.decapitalize( "" ) ).isEqualTo( "" ); assertThat( IntrospectorUtils.decapitalize( "URL" ) ).isEqualTo( "URL" ); assertThat( IntrospectorUtils.decapitalize( "FooBar" ) ).isEqualTo( "fooBar" ); assertThat( IntrospectorUtils.decapitalize( "PArtialCapitalized" ) ).isEqualTo( "PArtialCapitalized" ); assertThat( IntrospectorUtils.decapitalize( "notCapitalized" ) ).isEqualTo( "notCapitalized" ); assertThat( IntrospectorUtils.decapitalize( "a" ) ).isEqualTo( "a" ); }