### Question:
HelpFormatter { protected String rtrim(String s) { if (s == null || s.length() == 0) { return s; } int pos = s.length(); while (pos > 0 && Character.isWhitespace(s.charAt(pos - 1))) { --pos; } return s.substring(0, pos); }  void setWidth(int width); int getWidth(); void setLeftPadding(int padding); int getLeftPadding(); void setDescPadding(int padding); int getDescPadding(); void setSyntaxPrefix(String prefix); String getSyntaxPrefix(); void setNewLine(String newline); String getNewLine(); void setOptPrefix(String prefix); String getOptPrefix(); void setLongOptPrefix(String prefix); String getLongOptPrefix(); void setLongOptSeparator(String longOptSeparator); String getLongOptSeparator(); void setArgName(String name); String getArgName(); Comparator<Option> getOptionComparator(); void setOptionComparator(Comparator<Option> comparator); void printHelp(String cmdLineSyntax, Options options); void printHelp(String cmdLineSyntax, Options options, boolean autoUsage); void printHelp(String cmdLineSyntax, String header, Options options, String footer); void printHelp(String cmdLineSyntax, String header, Options options, String footer, boolean autoUsage); void printHelp(int width, String cmdLineSyntax, String header, Options options, String footer); void printHelp(int width, String cmdLineSyntax, String header,
                          Options options, String footer, boolean autoUsage); void printHelp(PrintWriter pw, int width, String cmdLineSyntax, 
                          String header, Options options, int leftPad, 
                          int descPad, String footer); void printHelp(PrintWriter pw, int width, String cmdLineSyntax,
                          String header, Options options, int leftPad,
                          int descPad, String footer, boolean autoUsage); void printUsage(PrintWriter pw, int width, String app, Options options); void printUsage(PrintWriter pw, int width, String cmdLineSyntax); void printOptions(PrintWriter pw, int width, Options options, 
                             int leftPad, int descPad); void printWrapped(PrintWriter pw, int width, String text); void printWrapped(PrintWriter pw, int width, int nextLineTabStop, String text); static final int DEFAULT_WIDTH; static final int DEFAULT_LEFT_PAD; static final int DEFAULT_DESC_PAD; static final String DEFAULT_SYNTAX_PREFIX; static final String DEFAULT_OPT_PREFIX; static final String DEFAULT_LONG_OPT_PREFIX; static final String DEFAULT_LONG_OPT_SEPARATOR; static final String DEFAULT_ARG_NAME; @Deprecated
    public int defaultWidth; @Deprecated
    public int defaultLeftPad; @Deprecated
    public int defaultDescPad; @Deprecated
    public String defaultSyntaxPrefix; @Deprecated
    public String defaultNewLine; @Deprecated
    public String defaultOptPrefix; @Deprecated
    public String defaultLongOptPrefix; @Deprecated
    public String defaultArgName; }### Answer:
@Test public void testRtrim() { HelpFormatter formatter = new HelpFormatter(); assertEquals(null, formatter.rtrim(null)); assertEquals("", formatter.rtrim("")); assertEquals(" foo", formatter.rtrim(" foo ")); }