content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Mon Mar 18 10:55:53 GMT 2024
   */
  
  package org.apache.commons.cli;
  
  import org.junit.jupiter.api.Test;
  import static org.junit.jupiter.api.Assertions.*;
  import org.junit.jupiter.api.Timeout;
  import java.util.concurrent.TimeUnit;
  import static org.evosuite.shaded.org.mockito.Mockito.*;
  import static org.evosuite.runtime.EvoAssertions.*;
  import java.io.StringWriter;
  import java.util.Comparator;
  import org.apache.commons.cli.HelpFormatter;
  import org.apache.commons.cli.Options;
  import org.evosuite.runtime.EvoRunner;
  import org.evosuite.runtime.EvoRunnerParameters;
  import org.evosuite.runtime.ViolatedAssumptionAnswer;
  import org.junit.runner.RunWith;
  
  @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
  public class HelpFormatter_ESTest extends HelpFormatter_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testRtrimReturningNonEmptyString() throws Throwable  {
        // No Comments were added
        HelpFormatter helpFormatter = new HelpFormatter();
        String rtrim = helpFormatter.rtrim("BEb} ,aLD_B2");
        assertEquals(3, helpFormatter.defaultDescPad);
        assertEquals("BEb} ,aLD_B2", rtrim);
        assertEquals(1, helpFormatter.defaultLeftPad);
        assertEquals("--", helpFormatter.getLongOptPrefix());
        assertEquals(74, helpFormatter.defaultWidth);
        assertEquals("usage: ", helpFormatter.getSyntaxPrefix());
        assertEquals("arg", helpFormatter.getArgName());
        assertEquals("-", helpFormatter.getOptPrefix());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testRenderWrappedTextReturningStringBufferWhereLengthIsZero() throws Throwable  {
        // Arrange
        HelpFormatter helpFormatter = new HelpFormatter();
        StringBuffer arg0 = new StringBuffer();
        
        // Act
        StringBuffer renderWrappedText = helpFormatter.renderWrappedText(arg0, 1, 10, " ");
        
        // Assert
        assertEquals("", renderWrappedText.toString());
        assertEquals(3, helpFormatter.defaultDescPad);
        assertEquals("--", helpFormatter.getLongOptPrefix());
        assertEquals(74, helpFormatter.defaultWidth);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testRenderOptionsReturningNull() throws Throwable  {
        // Given: A HelpFormatter instance with default values
        HelpFormatter helpFormatter = new HelpFormatter();
        
        // When: The renderOptions method is called with a non-null StringBuffer, 3 columns, and 99 width
        Options arg2 = new Options();
        helpFormatter.renderOptions((StringBuffer) null, 3, arg2, 3, 99);
        
        // Then: The syntax prefix is "usage:"
        assertEquals("usage: ", helpFormatter.getSyntaxPrefix());
        
        // And: The option prefix is "-"
        assertEquals("-", helpFormatter.getOptPrefix());
        
        // And: The default left padding is 1
        assertEquals(1, helpFormatter.defaultLeftPad);
        
        // And: The long option prefix is "--"
        assertEquals("--", helpFormatter.getLongOptPrefix());
        
        // And: The default description padding is 3
        assertEquals(3, helpFormatter.defaultDescPad);
        
        // And: The argument name is "arg"
        assertEquals("arg", helpFormatter.getArgName());
        
        // And: The default width is 74
        assertEquals(74, helpFormatter.defaultWidth);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testRenderOptionsReturningStringBufferWhereLengthIsZero() throws Throwable  {
        // Given a HelpFormatter object and some Options
        HelpFormatter helpFormatter = new HelpFormatter();
        Options options = new Options();
        
        // When the renderOptions method is called with an Options object
        StringBuffer buffer = new StringBuffer();
        helpFormatter.renderOptions(buffer, 1032, options, 63, 63);
        
        // Then the usage string is prefixed with "usage: "
        assertEquals("usage: ", helpFormatter.getSyntaxPrefix());
        
        // And the argument name is set to "arg"
        assertEquals("arg", helpFormatter.getArgName());
        
        // And the long option prefix is set to "--"
        assertEquals("--", helpFormatter.getLongOptPrefix());
        
        // And the default width is 74 characters
        assertEquals(74, helpFormatter.defaultWidth);
        
        // And the default description padding is 3 characters
        assertEquals(3, helpFormatter.defaultDescPad);
        
        // And the option prefix is set to "-"
        assertEquals("-", helpFormatter.getOptPrefix());
        
        // And the default left padding is 1 character
        assertEquals(1, helpFormatter.defaultLeftPad);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetSyntaxPrefixReturningNull() throws Throwable  {
        // rollbacked to evosuite
        HelpFormatter helpFormatter = new HelpFormatter();
        assertEquals("usage: ", helpFormatter.getSyntaxPrefix());
        
        helpFormatter.setSyntaxPrefix((String) null);
        String syntaxPrefix = helpFormatter.getSyntaxPrefix();
        assertEquals("-", helpFormatter.getOptPrefix());
        assertEquals(74, helpFormatter.defaultWidth);
        assertNull(syntaxPrefix);
        assertEquals("--", helpFormatter.getLongOptPrefix());
        assertEquals(1, helpFormatter.defaultLeftPad);
        assertEquals(3, helpFormatter.defaultDescPad);
        assertEquals("arg", helpFormatter.getArgName());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetSyntaxPrefixReturningEmptyString() throws Throwable  {
        // Create a new HelpFormatter instance
        HelpFormatter helpFormatter = new HelpFormatter();
        
        // Check the default syntax prefix value
        assertEquals("usage: ", helpFormatter.getSyntaxPrefix());
        
        // Set the syntax prefix to an empty string
        helpFormatter.setSyntaxPrefix("");
        
        // Check that the syntax prefix is now an empty string
        assertEquals("", helpFormatter.getSyntaxPrefix());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetOptPrefixReturningNull() throws Throwable  {
        // Create a new HelpFormatter instance
        HelpFormatter helpFormatter = new HelpFormatter();
        
        // Verify that the default option prefix is set to "-"
        assertEquals("-", helpFormatter.getOptPrefix());
        
        // Set the default option prefix to null and verify that it has been changed
        helpFormatter.defaultOptPrefix = null;
        String optPrefix = helpFormatter.getOptPrefix();
        assertNull(optPrefix);
        
        // Verify that the syntax prefix is set to "usage: "
        assertEquals("usage: ", helpFormatter.getSyntaxPrefix());
        
        // Verify that the long option prefix is set to "--"
        assertEquals("--", helpFormatter.getLongOptPrefix());
        
        // Verify that the default width is 74 characters
        assertEquals(74, helpFormatter.defaultWidth);
        
        // Verify that the default argument name is "arg"
        assertEquals("arg", helpFormatter.getArgName());
        
        // Verify that the default description padding is 3 spaces
        assertEquals(3, helpFormatter.defaultDescPad);
        
        // Verify that the default left padding is 1 space
        assertEquals(1, helpFormatter.defaultLeftPad);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetOptPrefix() throws Throwable  {
        // rollbacked to evosuite
        HelpFormatter helpFormatter = new HelpFormatter();
        assertEquals("-", helpFormatter.getOptPrefix());
        
        helpFormatter.setOptPrefix("");
        helpFormatter.getOptPrefix();
        assertEquals("", helpFormatter.getOptPrefix());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetNewLineReturningNull() throws Throwable  {
        // Given a HelpFormatter instance with default values
        HelpFormatter helpFormatter = new HelpFormatter();
        
        // When I set the new line to null
        helpFormatter.setNewLine(null);
        
        // Then the new line is set to the default value
        assertNull(helpFormatter.getNewLine());
        
        // And the other properties are still set to their default values
        assertEquals("-", helpFormatter.getOptPrefix());
        assertEquals("--", helpFormatter.getLongOptPrefix());
        assertEquals(74, helpFormatter.defaultWidth);
        assertEquals("arg", helpFormatter.getArgName());
        assertEquals(1, helpFormatter.defaultLeftPad);
        assertEquals(3, helpFormatter.defaultDescPad);
        assertEquals("usage: ", helpFormatter.getSyntaxPrefix());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetNewLineReturningEmptyString() throws Throwable  {
        // Create a new instance of HelpFormatter and set its new line character to an empty string
        HelpFormatter helpFormatter = new HelpFormatter();
        helpFormatter.setNewLine("");
        
        // Get the new line character for comparison
        String actualNewLine = helpFormatter.getNewLine();
        
        // Assert that the new line character is an empty string
        assertEquals("", actualNewLine);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetLongOptPrefix() throws Throwable  {
        HelpFormatter helpFormatter = new HelpFormatter();
        // Assert the default value of long opt prefix is "--"
        assertEquals("--", helpFormatter.getLongOptPrefix());
        
        // Set the long opt prefix to an empty string
        helpFormatter.setLongOptPrefix("");
        // Assert that the long opt prefix has been set to an empty string
        assertEquals("", helpFormatter.getLongOptPrefix());
        
        // Set the long opt prefix back to its original value
        helpFormatter.setLongOptPrefix("--");
        // Assert that the long opt prefix has been restored to its original value
        assertEquals("--", helpFormatter.getLongOptPrefix());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetLeftPaddingReturningNegative() throws Throwable  {
        HelpFormatter helpFormatter = new HelpFormatter();
        // Set the default left padding to -1586
        helpFormatter.defaultLeftPad = (-1586);
        // Get the current value of the left padding
        int leftPadding = helpFormatter.getLeftPadding();
        // Assert that the current value of the left padding is equal to -1586
        assertEquals((-1586), leftPadding);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetDescPaddingReturningZero() throws Throwable  {
        HelpFormatter helpFormatter = new HelpFormatter();
        // Given a HelpFormatter instance with default desc padding of 3
        
        helpFormatter.setDescPadding(0);
        int descPadding = helpFormatter.getDescPadding();
        // When the desc padding is set to 0
        
        assertEquals(0, helpFormatter.defaultDescPad);
        assertEquals(0, descPadding);
        // Then the default desc padding should be updated to 0
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetDescPaddingReturningNegative() throws Throwable  {
        // Given a HelpFormatter object with the default description padding set to -2443
        HelpFormatter helpFormatter = new HelpFormatter();
        helpFormatter.setDescPadding((-2443));
        
        // When the getDescPadding method is called on the HelpFormatter object
        int descPadding = helpFormatter.getDescPadding();
        
        // Then the value returned should be -2443, which is the default description padding set for the HelpFormatter object
        assertEquals((-2443), helpFormatter.defaultDescPad);
        assertEquals((-2443), descPadding);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetArgNameReturningNull() throws Throwable  {
        // rollbacked to evosuite
        HelpFormatter helpFormatter = new HelpFormatter();
        assertEquals("arg", helpFormatter.getArgName());
        
        helpFormatter.setArgName((String) null);
        String argName = helpFormatter.getArgName();
        assertEquals(3, helpFormatter.defaultDescPad);
        assertEquals("usage: ", helpFormatter.getSyntaxPrefix());
        assertEquals("--", helpFormatter.getLongOptPrefix());
        assertEquals(1, helpFormatter.defaultLeftPad);
        assertEquals(74, helpFormatter.defaultWidth);
        assertNull(argName);
        assertEquals("-", helpFormatter.getOptPrefix());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetArgNameReturningEmptyString() throws Throwable  {
        // Create a new HelpFormatter instance and set the argument name to "arg"
        HelpFormatter helpFormatter = new HelpFormatter();
        assertEquals("arg", helpFormatter.getArgName());
        
        // Set the argument name to an empty string
        helpFormatter.setArgName("");
        
        // Verify that the argument name is now an empty string
        assertEquals("", helpFormatter.getArgName());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testFindWrapPosReturningZero() throws Throwable  {
        HelpFormatter helpFormatter = new HelpFormatter();
        // Find the wrap position for the string " ]" with a starting position of 0 and a default description padding of 0
        int findWrapPos = helpFormatter.findWrapPos(" ]", 0, 0);
        // The wrap position should be 0 since there is no need to wrap the string at this point
        assertEquals(0, findWrapPos);
        
        // Test the getLongOptPrefix() method
        String longOptPrefix = helpFormatter.getLongOptPrefix();
        // The long option prefix should be "--"
        assertEquals("--", longOptPrefix);
        
        // Test the default description padding
        int defaultDescPad = helpFormatter.defaultDescPad;
        // The default description padding should be 3
        assertEquals(3, defaultDescPad);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testFindWrapPosReturningPositive() throws Throwable  {
        // Create a new instance of HelpFormatter with default parameters
        HelpFormatter formatter = new HelpFormatter();
        
        // Test the findWrapPos method with a long string that will be used as an example for the test data
        int wrapPos = formatter.findWrapPos("This is a long string that will be used as an example for the test data", 0, 0);
        
        // Assert that the wrap position is 4 (the length of the word "this")
        assertEquals(4, wrapPos);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testFindWrapPosReturningNegative() throws Throwable  {
        // No Comments were added
        HelpFormatter helpFormatter = new HelpFormatter();
        int findWrapPos = helpFormatter.findWrapPos("--", 3, 74);
        assertEquals(1, helpFormatter.defaultLeftPad);
        assertEquals("--", helpFormatter.getLongOptPrefix());
        assertEquals(3, helpFormatter.defaultDescPad);
        assertEquals((-1), findWrapPos);
        assertEquals("-", helpFormatter.getOptPrefix());
        assertEquals(74, helpFormatter.defaultWidth);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatePaddingReturningNonEmptyString() throws Throwable  {
        // Create a new instance of HelpFormatter
        HelpFormatter helpFormatter = new HelpFormatter();
        
        // Check that the default width is 120
        assertEquals(120, helpFormatter.defaultWidth);
        
        // Check that the argument name is "arg"
        assertEquals("arg", helpFormatter.getArgName());
        
        // Check that the syntax prefix is "usage: "
        assertEquals("usage: ", helpFormatter.getSyntaxPrefix());
        
        // Check that the default description padding is 3 spaces
        assertEquals(3, helpFormatter.defaultDescPad);
        
        // Check that the default left padding is 1 space
        assertEquals(1, helpFormatter.defaultLeftPad);
        
        // Check that the option prefix is "-"
        assertEquals("-", helpFormatter.getOptPrefix());
        
        // Check that the long option prefix is "--"
        assertEquals("--", helpFormatter.getLongOptPrefix());
        
        // Create a string with 120 spaces to use as padding
        String createPadding = helpFormatter.createPadding(120);
        
        // Check that the created padding has 120 spaces
        assertEquals("                                                                                                                        ", createPadding);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatePaddingReturningEmptyString() throws Throwable  {
        HelpFormatter helpFormatter = new HelpFormatter();
        // Given that we have a HelpFormatter object created
        String createPadding = helpFormatter.createPadding(0);
        // When we call createPadding with an argument of 0
        assertEquals("", createPadding);
        // Then the method should return an empty string
        assertEquals(3, helpFormatter.defaultDescPad);
        // Given that we have a HelpFormatter object with a default description padding of 3
        assertEquals("usage: ", helpFormatter.getSyntaxPrefix());
        // When we call getSyntaxPrefix on the HelpFormatter object
        assertEquals("arg", helpFormatter.getArgName());
        // Then the method should return "arg"
        assertEquals(1, helpFormatter.defaultLeftPad);
        // Given that we have a HelpFormatter object with a default left padding of 1
        assertEquals(74, helpFormatter.defaultWidth);
        // When we call getDefaultWidth on the HelpFormatter object
        assertEquals("--", helpFormatter.getLongOptPrefix());
        // Then the method should return "--"
        assertEquals("-", helpFormatter.getOptPrefix());
        // Given that we have a HelpFormatter object with a default option prefix of "-"
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetOptionComparator() throws Throwable  {
        // Create a new HelpFormatter instance
        HelpFormatter helpFormatter = new HelpFormatter();
        
        // Verify that the default option comparator is set correctly
        assertEquals("-", helpFormatter.getOptPrefix());
        
        // Verify that the default width is set to 74 characters
        assertEquals(74, helpFormatter.defaultWidth);
        
        // Verify that the default left padding is set to 1 character
        assertEquals(1, helpFormatter.defaultLeftPad);
        
        // Verify that the default description padding is set to 3 characters
        assertEquals(3, helpFormatter.defaultDescPad);
        
        // Verify that the arg name prefix is set correctly
        assertEquals("arg", helpFormatter.getArgName());
        
        // Verify that the long option prefix is set correctly
        assertEquals("--", helpFormatter.getLongOptPrefix());
        
        // Verify that the syntax prefix is set correctly
        assertEquals("usage: ", helpFormatter.getSyntaxPrefix());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrintHelpTaking6Arguments() throws Throwable  {
        // Given a HelpFormatter object
        HelpFormatter helpFormatter = new HelpFormatter();
        
        // When we create a new Options object
        Options arg3 = new Options();
        
        // Then we should use the addValueForProcessing method instead of the addValue method
        assertEquals("-", helpFormatter.getOptPrefix());
        
        // And defaultDescPad should be set to 3
        assertEquals(3, helpFormatter.defaultDescPad);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testRenderWrappedTextReturningStringBufferWhereLengthIsPositive() throws Throwable  {
        // Given: A HelpFormatter object and a StringBuffer containing the argument to be rendered.
        StringBuffer arg = new StringBuffer((CharSequence) "arg");
        HelpFormatter helpFormatter = new HelpFormatter();
        
        // When: The renderWrappedText method is called with the argument and 10 as the width, 1 as the indentation, and "\n" as the line separator.
        helpFormatter.renderWrappedText(arg, 10, 1, "\n");
        
        // Then: The length of the StringBuffer should be 5, and it should contain the rendered argument with a newline character at the end.
        assertEquals(5, arg.length());
        assertEquals("arg\n ", arg.toString());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testRtrimReturningEmptyString() throws Throwable  {
        HelpFormatter helpFormatter = new HelpFormatter();
        String rtrim = helpFormatter.rtrim(""); // Creates a new instance of the HelpFormatter class and initializes it with the empty string ""
        assertEquals("-", helpFormatter.getOptPrefix()); // Asserts that the option prefix is set to "-"
        assertEquals("usage: ", helpFormatter.getSyntaxPrefix()); // Asserts that the syntax prefix is set to "usage:"
        assertEquals(3, helpFormatter.defaultDescPad); // Asserts that the default description padding is set to 3 spaces
        assertEquals(1, helpFormatter.defaultLeftPad); // Asserts that the default left padding is set to 1 space
        assertEquals("arg", helpFormatter.getArgName()); // Asserts that the argument name is set to "arg"
        assertEquals("", rtrim); // Asserts that the string after trimming is empty
        assertEquals("--", helpFormatter.getLongOptPrefix()); // Asserts that the long option prefix is set to "--"
        assertEquals(74, helpFormatter.defaultWidth); // Asserts that the default width of the output is 74 characters
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testRtrimReturningNull() throws Throwable  {
        // Arrange
        HelpFormatter helpFormatter = new HelpFormatter();
        
        // Act
        String rtrim = helpFormatter.rtrim((String) null);
        
        // Assert
        assertEquals(3, helpFormatter.defaultDescPad);
        assertEquals("--", helpFormatter.getLongOptPrefix());
        assertEquals("-", helpFormatter.getOptPrefix());
        assertEquals(1, helpFormatter.defaultLeftPad);
        assertEquals(74, helpFormatter.defaultWidth);
        assertEquals("usage: ", helpFormatter.getSyntaxPrefix());
        assertEquals("arg", helpFormatter.getArgName());
        assertNull(rtrim);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testRenderOptionsThrowsStringIndexOutOfBoundsException() throws Throwable  {
        HelpFormatter helpFormatter = new HelpFormatter();
        Options arg2 = new Options();
        arg2.addOption("", false, "\n");
        StringBuffer arg0 = new StringBuffer("");
        
        // Test that a StringIndexOutOfBoundsException is thrown when the argument for the renderOptions method is negative
        try {
        helpFormatter.renderOptions(arg0, -610, arg2, 15, 15);
        fail("Expecting exception: StringIndexOutOfBoundsException");
        
        } catch(StringIndexOutOfBoundsException e) {
        // The expected exception is caught and the test passes
        assertTrue(true);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testRenderOptionsReturningStringBufferWhereLengthIsPositive() throws Throwable  {
        // Given a HelpFormatter and an Options object with some options
        HelpFormatter helpFormatter = new HelpFormatter();
        Options arg2 = new Options();
        arg2.addOption("", false, "\n");
        
        // When the renderOptions method is called with some arguments
        StringBuffer arg0 = new StringBuffer("");
        helpFormatter.renderOptions(arg0, 100, arg2, 15, 20);
        
        // Then the length of the rendered options should be equal to 70
        assertEquals(70, arg0.length());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testRenderOptionsWithStringBufferWhereLengthIsPositive() throws Throwable  {
        // Given a HelpFormatter object and an Options object with an "arg" option
        HelpFormatter helpFormatter = new HelpFormatter();
        Options arg2 = new Options();
        arg2.addOption("arg", true, "usage: ");
        
        // When the renderOptions method is called with some arguments
        StringWriter stringWriter = new StringWriter(8);
        StringBuffer arg0 = stringWriter.getBuffer();
        helpFormatter.renderOptions(arg0, 940, arg2, 940, 1);
        
        // Then the method should render the options in a specific format
        assertEquals(41, arg0.length());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrintHelpTaking3Strings1And1WithFalse() throws Throwable  {
        // Given a HelpFormatter object and an Options object with some options
        HelpFormatter helpFormatter = new HelpFormatter();
        Options arg2 = new Options();
        arg2.addOption("", "", false, "");
        arg2.addOption("arg", false, "usage: ");
        
        // When the printHelp method is called with the Options object and a syntax prefix
        helpFormatter.printHelp("arg", "arg", arg2, "arg", false);
        
        // Then the usage message should be printed with the correct syntax prefix
        assertEquals("usage: ", helpFormatter.getSyntaxPrefix());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrintHelpTaking3Strings1And1WithTrue() throws Throwable  {
        // Given: a HelpFormatter object and an Options object
        HelpFormatter helpFormatter = new HelpFormatter();
        Options arg2 = new Options();
        arg2.addOption((String) null, true, (String) null);
        
        // When: the printHelp method is called with the arguments "cIj?~nqn[{^-0J8" and null
        helpFormatter.printHelp("cIj?~nqn[{^-0J8", (String) null, arg2, (String) null, true);
        
        // Then: the defaultDescPad value of the HelpFormatter object is set to 3
        assertEquals(3, helpFormatter.defaultDescPad);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetOptionComparatorWithNull() throws Throwable  {
        // Create a new HelpFormatter object
        HelpFormatter helpFormatter = new HelpFormatter();
        
        // Set the option comparator to null
        helpFormatter.setOptionComparator((Comparator) null);
        
        // Test that the syntax prefix is "usage:"
        assertEquals("usage: ", helpFormatter.getSyntaxPrefix());
        
        // Test that the argument name is "arg"
        assertEquals("arg", helpFormatter.getArgName());
        
        // Test that the default description padding is 3 spaces
        assertEquals(3, helpFormatter.defaultDescPad);
        
        // Test that the long option prefix is "--"
        assertEquals("--", helpFormatter.getLongOptPrefix());
        
        // Test that the default left padding is 1 space
        assertEquals(1, helpFormatter.defaultLeftPad);
        
        // Test that the short option prefix is "-"
        assertEquals("-", helpFormatter.getOptPrefix());
        
        // Test that the default width is 74 characters
        assertEquals(74, helpFormatter.defaultWidth);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetOptionComparatorWithNonNull() throws Throwable  {
        // Given a HelpFormatter object "helpFormatter"
        HelpFormatter helpFormatter = new HelpFormatter();
        
        // When setting an option comparator for the help formatter
        Comparator<Object> optionComparator = (Comparator<Object>) mock(Comparator.class, new ViolatedAssumptionAnswer());
        helpFormatter.setOptionComparator(optionComparator);
        
        // Then the option comparator should be set correctly
        assertEquals("-", helpFormatter.getOptPrefix());
        assertEquals(1, helpFormatter.defaultLeftPad);
        assertEquals(3, helpFormatter.defaultDescPad);
        assertEquals("usage: ", helpFormatter.getSyntaxPrefix());
        assertEquals("arg", helpFormatter.getArgName());
        assertEquals(74, helpFormatter.defaultWidth);
        assertEquals("--", helpFormatter.getLongOptPrefix());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetOptPrefixReturningNonEmptyString() throws Throwable  {
        // Test the default values of the HelpFormatter object
        HelpFormatter helpFormatter = new HelpFormatter();
        
        // Check that the default padding for descriptions is 3 spaces
        assertEquals(3, helpFormatter.defaultDescPad);
        
        // Check that the default padding for left-hand side arguments is 1 space
        assertEquals(1, helpFormatter.defaultLeftPad);
        
        // Check that the default prefix for long options is "--"
        assertEquals("--", helpFormatter.getLongOptPrefix());
        
        // Check that the default syntax prefix is "usage: "
        assertEquals("usage: ", helpFormatter.getSyntaxPrefix());
        
        // Check that the default prefix for short options is "-"
        assertEquals("-", helpFormatter.getOptPrefix());
        
        // Check that the default width of the HelpFormatter object is 74 characters
        assertEquals(74, helpFormatter.defaultWidth);
        
        // Check that the default name for arguments is "arg"
        assertEquals("arg", helpFormatter.getArgName());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetSyntaxPrefixReturningNonEmptyString() throws Throwable  {
        // No Comments were added
        HelpFormatter helpFormatter = new HelpFormatter();
        String syntaxPrefix = helpFormatter.getSyntaxPrefix();
        assertEquals(1, helpFormatter.defaultLeftPad);
        assertEquals(3, helpFormatter.defaultDescPad);
        assertEquals("-", helpFormatter.getOptPrefix());
        assertEquals("usage: ", syntaxPrefix);
        assertEquals(74, helpFormatter.defaultWidth);
        assertEquals("arg", helpFormatter.getArgName());
        assertEquals("--", helpFormatter.getLongOptPrefix());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetLongOptPrefixReturningNonEmptyString() throws Throwable  {
        // Create a new instance of the HelpFormatter class
        HelpFormatter helpFormatter = new HelpFormatter();
        
        // Set the default padding values for the option and argument names
        assertEquals(1, helpFormatter.defaultLeftPad);
        assertEquals(74, helpFormatter.defaultWidth);
        
        // Set the default prefixes for the option and argument names
        String longOptPrefix = helpFormatter.getLongOptPrefix();
        assertEquals("--", longOptPrefix);
        String optPrefix = helpFormatter.getOptPrefix();
        assertEquals("-", optPrefix);
        
        // Set the default padding values for the descriptions
        assertEquals(3, helpFormatter.defaultDescPad);
        
        // Test the getSyntaxPrefix method
        assertEquals("usage: ", helpFormatter.getSyntaxPrefix());
        
        // Test the getArgName method
        assertEquals("arg", helpFormatter.getArgName());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrintHelpTaking3Arguments() throws Throwable  {
        // Create a new instance of HelpFormatter and Options
        HelpFormatter helpFormatter = new HelpFormatter();
        Options arg1 = new Options();
        
        // Call the printHelp method with "myApp" as the first argument
        helpFormatter.printHelp("myApp", arg1, true);
        
        // Assert that the getArgName method returns "arg"
        assertEquals("arg", helpFormatter.getArgName());
        
        // Assert that the getSyntaxPrefix method returns "usage: "
        assertEquals("usage: ", helpFormatter.getSyntaxPrefix());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetNewLineReturningNonEmptyString() throws Throwable  {
        // No Comments were added
        HelpFormatter helpFormatter = new HelpFormatter();
        String newLine = helpFormatter.getNewLine();
        assertEquals(3, helpFormatter.defaultDescPad);
        assertEquals("\n", newLine);
        assertEquals("--", helpFormatter.getLongOptPrefix());
        assertEquals(1, helpFormatter.defaultLeftPad);
        assertEquals("arg", helpFormatter.getArgName());
        assertEquals("-", helpFormatter.getOptPrefix());
        assertEquals(74, helpFormatter.defaultWidth);
        assertEquals("usage: ", helpFormatter.getSyntaxPrefix());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetArgNameReturningNonEmptyString() throws Throwable  {
        // Create a new HelpFormatter instance
        HelpFormatter helpFormatter = new HelpFormatter();
        
        // Test the default width and left pad values
        assertEquals(74, helpFormatter.defaultWidth);
        assertEquals(1, helpFormatter.defaultLeftPad);
        
        // Test the option prefix values
        assertEquals("-", helpFormatter.getOptPrefix());
        assertEquals("--", helpFormatter.getLongOptPrefix());
        
        // Test the syntax prefix value
        assertEquals("usage: ", helpFormatter.getSyntaxPrefix());
        
        // Test the argument name value
        assertEquals("arg", helpFormatter.getArgName());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetLeftPaddingReturningPositive() throws Throwable  {
        // Create a new instance of the HelpFormatter class
        HelpFormatter helpFormatter = new HelpFormatter();
        
        // Get the left padding value for the syntax prefix
        int leftPadding = helpFormatter.getLeftPadding();
        
        // Check that the syntax prefix is set to "usage: "
        assertEquals("usage: ", helpFormatter.getSyntaxPrefix());
        
        // Check that the arg name is set to "arg"
        assertEquals("arg", helpFormatter.getArgName());
        
        // Check that the long option prefix is set to "--"
        assertEquals("--", helpFormatter.getLongOptPrefix());
        
        // Check that the default width is 74
        assertEquals(74, helpFormatter.defaultWidth);
        
        // Check that the left padding value is 1
        assertEquals(1, leftPadding);
        
        // Check that the option prefix is set to "-"
        assertEquals("-", helpFormatter.getOptPrefix());
        
        // Check that the default description padding is 3
        assertEquals(3, helpFormatter.defaultDescPad);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetWidth() throws Throwable  {
        // No Comments were added
        HelpFormatter helpFormatter = new HelpFormatter();
        helpFormatter.setWidth((-2551));
        int width = helpFormatter.getWidth();
        assertEquals((-2551), helpFormatter.defaultWidth);
        assertEquals((-2551), width);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrintHelpTaking2Arguments() throws Throwable  {
        // Given a HelpFormatter and Options objects
        HelpFormatter helpFormatter = new HelpFormatter();
        Options arg1 = new Options();
        
        // When printHelp method is called with illegal character value '\u00A9'
        helpFormatter.printHelp("opt contains illegal character value '\u00A9'", arg1);
        
        // Then the usage string should be prefixed with "usage: "
        assertEquals("usage: ", helpFormatter.getSyntaxPrefix());
        
        // And the default width of the formatter should be 74 characters
        assertEquals(74, helpFormatter.defaultWidth);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrintHelpTaking13StringsAnd1() throws Throwable  {
        // Given: We have a HelpFormatter instance named helpFormatter and an Options object named arg3.
        HelpFormatter helpFormatter = new HelpFormatter();
        Options arg3 = new Options();
        
        // When: We call the printHelp method on the HelpFormatter instance with arguments (13, "MyCommand", "", arg3, "-f <input_file> -o <output_file>").
        helpFormatter.printHelp(13, "MyCommand", "", arg3, "-f <input_file> -o <output_file>");
        
        // Then: We assert that the defaultWidth property of the HelpFormatter instance is 74.
        assertEquals(74, helpFormatter.defaultWidth);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetLeftPadding() throws Throwable  {
        // Given a HelpFormatter instance
        HelpFormatter helpFormatter = new HelpFormatter();
        
        // When we set the left padding to 63
        helpFormatter.setLeftPadding(63);
        
        // Then the default left padding should be equal to 63
        assertEquals(63, helpFormatter.defaultLeftPad);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetDescPaddingReturningPositive() throws Throwable  {
        // No Comments were added
        HelpFormatter helpFormatter = new HelpFormatter();
        int descPadding = helpFormatter.getDescPadding();
        assertEquals("usage: ", helpFormatter.getSyntaxPrefix());
        assertEquals(3, descPadding);
        assertEquals(1, helpFormatter.defaultLeftPad);
        assertEquals("-", helpFormatter.getOptPrefix());
        assertEquals(74, helpFormatter.defaultWidth);
        assertEquals("arg", helpFormatter.getArgName());
        assertEquals("--", helpFormatter.getLongOptPrefix());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetWidthReturningPositive() throws Throwable  {
        // Given a HelpFormatter instance
        HelpFormatter helpFormatter = new HelpFormatter();
        
        // When we get the width of the formatter
        int width = helpFormatter.getWidth();
        
        // Then the width should be 74
        assertEquals(74, width);
        
        // And the prefix for long options should be "--"
        assertEquals("--", helpFormatter.getLongOptPrefix());
        
        // And the prefix for short options should be "-"
        assertEquals("-", helpFormatter.getOptPrefix());
        
        // And the name of the argument should be "arg"
        assertEquals("arg", helpFormatter.getArgName());
        
        // And the default padding for left justification should be 1
        assertEquals(1, helpFormatter.defaultLeftPad);
        
        // And the prefix for syntax usage should be "usage: "
        assertEquals("usage: ", helpFormatter.getSyntaxPrefix());
        
        // And the default padding for description should be 3
        assertEquals(3, helpFormatter.defaultDescPad);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrintHelpTaking4Arguments() throws Throwable  {
        // Given a HelpFormatter object and some Options data
        HelpFormatter helpFormatter = new HelpFormatter();
        Options arg2 = new Options();
        
        // When the printHelp method is called with some arguments
        helpFormatter.printHelp("-", "-", arg2, "-");
        
        // Then the getOptPrefix method should return the correct value
        assertEquals("-", helpFormatter.getOptPrefix());
    }
  }
  