StringUtil { public static String getMapAsPrettyString( final Map map ) { final ByteArrayOutputStream writtenBytes = new ByteArrayOutputStream(); MapUtils.debugPrint( new PrintStream( writtenBytes ), "Map", map ); return writtenBytes.toString(); } private  StringUtil(); static String[] tokenStringToArray( final String tokenizedString, final String token ); static boolean doesPathContainParentPathSegment( final String path ); static void main( final String[] args ); static boolean isEmpty( final String str ); static String getMapAsPrettyString( final Map map ); static Map<String, String> trimStringMap( Map<String, String> map ); static List<String> trimStringList( List<String> list ); static String trimToEmpty( String string );  }
@Test public void testGetMapAsPrettyStringEmpty() { Assert.assertEquals( "Map = null" + System.getProperty( "line.separator" ), StringUtil.getMapAsPrettyString( null ) ); Assert.assertEquals( "Map = " + System.getProperty( "line.separator" ) + "{" + System.getProperty( "line" + ".separator" ) + "} java.util.HashMap" + System.getProperty( "line.separator" ), StringUtil .getMapAsPrettyString( new HashMap() ) ); }
@Test public void testGetMapAsPrettyString() { final Map testMap = getTestMap(); final String output = StringUtil.getMapAsPrettyString( testMap ); final String expectedOutput = getExpectedPrettyMapOutput(); Assert.assertEquals( expectedOutput, output ); }