### Question:
StringUtil { public static String trimEnd( final String source, char c ) { if ( source == null ) { return null; } int index = source.length(); while ( index > 0 && source.charAt( index - 1 ) == c ) { index--; } return source.substring( 0, index ); }  static String substitute( String aString, Map<String, String> variablesValues, String open, String close ); static String substitute( String aString, Map<String, String> variablesValues, String open, String close,
                                   int recursion ); static String substituteHex( String aString ); static final synchronized String environmentSubstitute( String aString,
                                                                 Map<String, String> systemProperties ); static String substituteUnix( String aString, Map<String, String> variables ); static String substituteWindows( String aString, Map<String, String> variables ); static String substituteField( String aString, IRowMeta rowMeta, Object[] rowData ); static void getUsedVariables( String aString, String open, String close, List<String> list,
                                       boolean includeSystemVariables ); static boolean isSystemVariable( String aString ); static void getUsedVariables( String aString, List<String> list, boolean includeSystemVariables ); static final String generateRandomString( int length, String prefix, String postfix, boolean uppercase ); static String initCap( String st ); static double str2num( String pattern, String decimal, String grouping, String currency, String value ); static final boolean isEmpty( String string ); static final boolean isEmpty( StringBuilder string ); static Date str2dat( String arg0, String arg1, String val ); static String getIndent( int indentLevel ); static String getFormattedDateTime( Date date ); static String getFormattedDateTime( Date date, boolean milliseconds ); static String getFormattedDateTimeNow(); static String getFormattedDateTimeNow( boolean milliseconds ); static boolean IsInteger( String str ); static boolean IsNumber( String str ); static boolean IsDate( String str ); static boolean IsDate( String str, String mask ); static final String getVariableName( String variable ); static boolean isVariable( String variable ); static String safeToLowerCase( final Object obj ); static String trimStart( final String source, char c ); static String trimEnd( final String source, char c ); static final String UNIX_OPEN; static final String UNIX_CLOSE; static final String WINDOWS_OPEN; static final String WINDOWS_CLOSE; static final String HEX_OPEN; static final String HEX_CLOSE; static final String FIELD_OPEN; static final String FIELD_CLOSE; static final String CRLF; static final String INDENTCHARS; static final String EMPTY_STRING; static final String[] SYSTEM_PROPERTIES; }### Answer:
@Test public void testTrimEnd_Single() { assertEquals( "/file/path", StringUtil.trimEnd( "/file/path/", '/' ) ); }
@Test public void testTrimEnd_Many() { assertEquals( "/file/path", StringUtil.trimEnd( "/file/path }
@Test public void testTrimEnd_None() { assertEquals( "/file/path", StringUtil.trimEnd( "/file/path", '/' ) ); }