content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Mon Mar 18 11:35:37 GMT 2024
   */
  
  package org.apache.commons.codec.language;
  
  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.runtime.EvoAssertions.*;
  import org.apache.commons.codec.language.DoubleMetaphone;
  import org.evosuite.runtime.EvoRunner;
  import org.evosuite.runtime.EvoRunnerParameters;
  import org.junit.runner.RunWith;
  
  @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
  public class DoubleMetaphone_ESTest extends DoubleMetaphone_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsDoubleMetaphoneEqualTaking3ArgumentsReturningTrue() throws Throwable  {
        // rollbacked to evosuite
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        doubleMetaphone.isDoubleMetaphoneEqual("A", "A", false);
        assertEquals(4, doubleMetaphone.getMaxCodeLen());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetMaxCodeLenReturningZero() throws Throwable  {
        // No Comments were added
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        assertEquals(4, doubleMetaphone.getMaxCodeLen());
        
        doubleMetaphone.setMaxCodeLen(0);
        int maxCodeLen = doubleMetaphone.getMaxCodeLen();
        assertEquals(0, maxCodeLen);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetMaxCodeLenReturningNegative() throws Throwable  {
        // Given a DoubleMetaphone object with the default maximum code length
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        
        // When the maximum code length is set to a negative value
        int maxCodeLen = -596;
        doubleMetaphone.setMaxCodeLen(maxCodeLen);
        
        // Then the maximum code length should be set to a positive value
        assertEquals(Math.abs(maxCodeLen), doubleMetaphone.getMaxCodeLen());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEncodeTakingObjectReturningNull() throws Throwable  {
        // Test that the DoubleMetaphone class correctly encodes a string and returns its length
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        Object encode = doubleMetaphone.encode((Object) "");
        assertEquals(4, doubleMetaphone.getMaxCodeLen()); // Assert that the maximum code length is 4
        assertNull(encode); // Assert that the encoded string is null
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDoubleMetaphoneReturningEmptyString() throws Throwable  {
        // Test the DoubleMetaphone class with a simple input string "6"
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        doubleMetaphone.doubleMetaphone("`6");
        
        // Assert that the max code length is 4, as expected
        assertEquals(4, doubleMetaphone.getMaxCodeLen());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testContainsReturningTrue() throws Throwable  {
        // Given a single character input and a valid index
        String[] arg3 = new String[6];
        arg3[1] = "";
        
        // When the method is called with these inputs
        boolean contains = DoubleMetaphone.contains("PSCK", 0, 0, arg3);
        
        // Then the method should return true, indicating that the input string contains the pattern
        assertTrue(contains);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testContainsReturningFalse() throws Throwable  {
        // rollbacked to evosuite
        String[] arg3 = new String[0];
        boolean contains = DoubleMetaphone.contains("org.apache.commons.codec.EncoderException", (-1084), (-857), arg3);
        assertFalse(contains);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCharAtReturningOtherChar() throws Throwable  {
        // Given a DoubleMetaphone instance
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        
        // When we call charAt("6", -548)
        char charAt = doubleMetaphone.charAt("6", (-548));
        
        // Then the character at that position should be 0x00 (the null character)
        assertEquals('\u0000', charAt);
        
        // And the maximum code length for this instance should be 4
        assertEquals(4, doubleMetaphone.getMaxCodeLen());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCharAtReturningDigit() throws Throwable  {
        // No Comments were added
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        char charAt = doubleMetaphone.charAt("wFa2;0d-(PR]&_6ZF", 3);
        assertEquals(4, doubleMetaphone.getMaxCodeLen());
        assertEquals('2', charAt);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCharAtReturningAlphabeticChar() throws Throwable  {
        // No Comments were added
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        char charAt = doubleMetaphone.charAt("org.apache.commons.codec.EncoderException", 0);
        assertEquals('o', charAt);
        assertEquals(4, doubleMetaphone.getMaxCodeLen());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsComplete() throws Throwable  {
        // Given a DoubleMetaphone object
        DoubleMetaphone arg0 = new DoubleMetaphone();
        
        // When the DoubleMetaphoneResult is created with a length of 651 characters
        DoubleMetaphone.DoubleMetaphoneResult doubleMetaphone_DoubleMetaphoneResult = arg0.new DoubleMetaphoneResult(651);
        
        // Then the result should not be complete
        boolean complete = doubleMetaphone_DoubleMetaphoneResult.isComplete();
        assertFalse(complete);
        
        // And the maximum code length should be 4 characters long
        assertEquals(4, arg0.getMaxCodeLen());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendAlternateTakingStringAndAppendAlternateTakingString() throws Throwable  {
        // Create a new instance of DoubleMetaphone
        DoubleMetaphone arg0 = new DoubleMetaphone();
        
        // Create a new instance of DoubleMetaphoneResult with a capacity of 651
        DoubleMetaphone.DoubleMetaphoneResult doubleMetaphone_DoubleMetaphoneResult = arg0.new DoubleMetaphoneResult(651);
        
        // Append the alternate string "TIA" to the result
        doubleMetaphone_DoubleMetaphoneResult.appendAlternate("TIA");
        
        // Verify that the getAlternate method returns the expected value
        assertEquals("TIA", doubleMetaphone_DoubleMetaphoneResult.getAlternate());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendAlternateTakingString() throws Throwable  {
        // No Comments were added
        DoubleMetaphone arg0 = new DoubleMetaphone();
        DoubleMetaphone.DoubleMetaphoneResult doubleMetaphone_DoubleMetaphoneResult = arg0.new DoubleMetaphoneResult((-3165));
        // Undeclared exception!
        try { 
          doubleMetaphone_DoubleMetaphoneResult.appendAlternate("&^>f}'PA6oSxN");
          fail("Expecting exception: StringIndexOutOfBoundsException");
        
        } catch(StringIndexOutOfBoundsException e) {
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesDoubleMetaphoneResultTaking2ArgumentsAndCallsAppendPrimaryTakingString() throws Throwable  {
        // No Comments were added
        DoubleMetaphone arg0 = new DoubleMetaphone();
        DoubleMetaphone.DoubleMetaphoneResult doubleMetaphone_DoubleMetaphoneResult = arg0.new DoubleMetaphoneResult(620);
        doubleMetaphone_DoubleMetaphoneResult.appendPrimary("bn>@\"8ue@b0z~*xPaT");
        assertEquals(4, arg0.getMaxCodeLen());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendPrimaryTakingString() throws Throwable  {
        // Test for DoubleMetaphone class
        // Create a new instance of the DoubleMetaphone class
        DoubleMetaphone arg0 = new DoubleMetaphone();
        
        // Create a new instance of the DoubleMetaphoneResult class
        DoubleMetaphone.DoubleMetaphoneResult doubleMetaphone_DoubleMetaphoneResult = arg0.new DoubleMetaphoneResult(1);
        
        // Append the character 'T' to the primary sound
        doubleMetaphone_DoubleMetaphoneResult.appendPrimary('T');
        
        // Append the string "T" to the primary sound
        doubleMetaphone_DoubleMetaphoneResult.appendPrimary("T");
        
        // Assert that the primary sound is equal to 'T'
        assertEquals("T", doubleMetaphone_DoubleMetaphoneResult.getPrimary());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesDoubleMetaphoneResultTaking2ArgumentsAndCallsAppendAlternateTakingChar0() throws Throwable  {
        // Creating a new instance of the DoubleMetaphone class with an input string length of 1883 characters
        DoubleMetaphone arg0 = new DoubleMetaphone();
        
        // Creating a new instance of the DoubleMetaphoneResult class and passing in the maximum length of the input string
        DoubleMetaphone.DoubleMetaphoneResult doubleMetaphone_DoubleMetaphoneResult = arg0.new DoubleMetaphoneResult(1883);
        
        // Appending a new character to the alternate code point list
        doubleMetaphone_DoubleMetaphoneResult.appendAlternate('V');
        
        // Asserting that the appended character is equal to 'V'
        assertEquals("V", doubleMetaphone_DoubleMetaphoneResult.getAlternate());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesDoubleMetaphoneResultTaking2ArgumentsAndCallsAppendAlternateTakingChar1() throws Throwable  {
        // Set up test data
        DoubleMetaphone arg0 = new DoubleMetaphone();
        DoubleMetaphone.DoubleMetaphoneResult doubleMetaphoneResult = arg0.new DoubleMetaphoneResult(-108);
        // Add alternate character to the result
        doubleMetaphoneResult.appendAlternate('S');
        // Check that max code length is 4
        assertEquals(4, arg0.getMaxCodeLen());
        // Check that the alternate character is empty string
        assertEquals("", doubleMetaphoneResult.getAlternate());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetMaxCodeLenReturningPositive() throws Throwable  {
        // Given: A DoubleMetaphone object is created and the maximum length of the code is retrieved
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        int maxCodeLen = doubleMetaphone.getMaxCodeLen();
        
        // When: The maximum length of the code is asserted to be equal to 4
        assertEquals(4, maxCodeLen);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetPrimary() throws Throwable  {
        // rollbacked to evosuite
        DoubleMetaphone arg0 = new DoubleMetaphone();
        DoubleMetaphone.DoubleMetaphoneResult doubleMetaphone_DoubleMetaphoneResult = arg0.new DoubleMetaphoneResult((-2258));
        doubleMetaphone_DoubleMetaphoneResult.getPrimary();
        assertEquals(4, arg0.getMaxCodeLen());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendTakingChar() throws Throwable  {
        // Test the case where the input string is null
        DoubleMetaphone arg0 = new DoubleMetaphone();
        DoubleMetaphone.DoubleMetaphoneResult doubleMetaphone_DoubleMetaphoneResult = arg0.new DoubleMetaphoneResult(651);
        doubleMetaphone_DoubleMetaphoneResult.append('\u0000');
        
        // Assert that the primary result is null since the input string is null
        assertEquals("\u0000", doubleMetaphone_DoubleMetaphoneResult.getPrimary());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendTaking2Strings() throws Throwable  {
        // No Comments were added
        DoubleMetaphone arg0 = new DoubleMetaphone();
        DoubleMetaphone.DoubleMetaphoneResult doubleMetaphone_DoubleMetaphoneResult = arg0.new DoubleMetaphoneResult((-121));
        // Undeclared exception!
        try { 
          doubleMetaphone_DoubleMetaphoneResult.append("0", "0");
          fail("Expecting exception: StringIndexOutOfBoundsException");
        
        } catch(StringIndexOutOfBoundsException e) {
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendTakingString() throws Throwable  {
        // No Comments were added
        DoubleMetaphone arg0 = new DoubleMetaphone();
        DoubleMetaphone.DoubleMetaphoneResult doubleMetaphone_DoubleMetaphoneResult = arg0.new DoubleMetaphoneResult(1);
        doubleMetaphone_DoubleMetaphoneResult.append("M*T'J:\"s,${Unp!i");
        boolean complete = doubleMetaphone_DoubleMetaphoneResult.isComplete();
        assertEquals("M", doubleMetaphone_DoubleMetaphoneResult.getAlternate());
        assertTrue(complete);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetAlternate() throws Throwable  {
        // Tests the getMaxCodeLen method of DoubleMetaphone class
        // Creates a new instance of DoubleMetaphone class
        DoubleMetaphone arg0 = new DoubleMetaphone();
        
        // Creates a new instance of DoubleMetaphoneResult class with length 0
        DoubleMetaphone.DoubleMetaphoneResult doubleMetaphone_DoubleMetaphoneResult = arg0.new DoubleMetaphoneResult(0);
        
        // Gets the alternate code for the input word
        doubleMetaphone_DoubleMetaphoneResult.getAlternate();
        
        // Asserts that the maximum length of the generated code is 4
        assertEquals(4, arg0.getMaxCodeLen());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendTaking2Chars() throws Throwable  {
        // Given a DoubleMetaphone object with a DoubleMetaphoneResult object that has been appended with the primary and alternate code for a word
        DoubleMetaphone arg0 = new DoubleMetaphone();
        DoubleMetaphone.DoubleMetaphoneResult doubleMetaphone_DoubleMetaphoneResult = arg0.new DoubleMetaphoneResult(2);
        doubleMetaphone_DoubleMetaphoneResult.appendPrimary('*');
        doubleMetaphone_DoubleMetaphoneResult.append('#', '1');
        
        // When the isComplete method is called on the DoubleMetaphoneResult object
        boolean complete = doubleMetaphone_DoubleMetaphoneResult.isComplete();
        
        // Then the method should return false, indicating that the result is not complete
        assertFalse(complete);
        
        // And the alternate code for the word should be "1"
        assertEquals("1", doubleMetaphone_DoubleMetaphoneResult.getAlternate());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesDoubleMetaphoneResultTaking2ArgumentsAndCallsAppendPrimaryTakingChar() throws Throwable  {
        // Given a DoubleMetaphone object
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        
        // When the object is instantiated with a maximum code length of 4 characters
        DoubleMetaphone.DoubleMetaphoneResult result = doubleMetaphone.new DoubleMetaphoneResult(0);
        
        // Then the primary code should be an empty string
        assertEquals("", result.getPrimary());
        
        // And the maximum code length should be 4 characters long
        assertEquals(4, doubleMetaphone.getMaxCodeLen());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDoubleMetaphoneReturningNull() throws Throwable  {
        // Given a DoubleMetaphone object
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        
        // When a String is passed to doubleMetaphone method with a null value
        doubleMetaphone.doubleMetaphone((String) null);
        
        // Then the maximum length of the code returned by getMaxCodeLen should be equal to 4
        assertEquals(4, doubleMetaphone.getMaxCodeLen());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEncodeTakingString0() throws Throwable  {
        // rollbacked to evosuite
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        String encode = doubleMetaphone.encode("V%%vd%{MM:QdU_Cq}");
        assertEquals("FFTM", encode);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsDoubleMetaphoneEqualTaking2ArgumentsAndIsDoubleMetaphoneEqualTaking2ArgumentsReturningTrue0() throws Throwable  {
        // This test checks if the double metaphone algorithm is able to identify
        // two words that are spelled the same but have different pronunciation as equal.
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        boolean doubleMetaphoneEqual = doubleMetaphone.isDoubleMetaphoneEqual("CHORE", "CHORE");
        assertTrue(doubleMetaphoneEqual);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsDoubleMetaphoneEqualTaking3Arguments0() throws Throwable  {
        // Given a DoubleMetaphone class that takes in two strings and returns true if they are equal when using double metaphone
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        
        // When we check if "K" and "BACHER" are equal with the isDoubleMetaphoneEqual method
        boolean doubleMetaphoneEqual = doubleMetaphone.isDoubleMetaphoneEqual("K", "BACHER", false);
        
        // Then we expect that they are not equal since they have different lengths
        assertFalse(doubleMetaphoneEqual);
        
        // And we also check the length of the max code generated by the isDoubleMetaphoneEqual method
        assertEquals(4, doubleMetaphone.getMaxCodeLen());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsDoubleMetaphoneEqualTaking2ArgumentsAndIsDoubleMetaphoneEqualTaking2ArgumentsReturningTrue1() throws Throwable  {
        // This test ensures that the DoubleMetaphone class correctly detects and reports
        // whether two strings are identical when compared using the Double Metaphone algorithm.
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        doubleMetaphone.isDoubleMetaphoneEqual(";shZh^NwBdhz", ";shZh^NwBdhz");
        assertEquals(4, doubleMetaphone.getMaxCodeLen());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEncodeTakingString1() throws Throwable  {
        // Given a string "x"
        String input = "x";
        
        // When the string is encoded using Double Metaphone
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        String encode = doubleMetaphone.encode(input);
        
        // Then the encoded string should be "S"
        assertEquals("S", encode);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEncodeTakingStringReturningEmptyString() throws Throwable  {
        // Given a DoubleMetaphone object
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        
        // When we encode the word "w" using the DoubleMetaphone algorithm
        String encodedWord = doubleMetaphone.encode("w");
        
        // Then we expect the encoded word to be empty string ""
        assertEquals("", encodedWord);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEncodeTakingString2() throws Throwable  {
        // Given a string "Matthew"
        String input = "Matthew";
        
        // When the input is passed to the DoubleMetaphone method
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        String encode = doubleMetaphone.encode(input);
        
        // Then the output should be "M0"
        assertEquals("M0", encode);
        
        // And the maximum length of the code should be 4
        assertEquals(4, doubleMetaphone.getMaxCodeLen());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEncodeTakingString3() throws Throwable  {
        // Given a string with special characters and numbers
        String input = "PSPSCED<1R!WKW:5~G";
        
        // When the string is encoded using Double Metaphone
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        String encode = doubleMetaphone.encode(input);
        
        // Then the resulting encoding should be "SPST"
        assertEquals("SPST", encode);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEncodeTakingString4() throws Throwable  {
        // Given a string "SCH"
        String input = "SCH";
        
        // When the string is encoded using DoubleMetaphone
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        String encode = doubleMetaphone.encode(input);
        
        // Then the resulting code should be of length 4
        assertEquals(4, doubleMetaphone.getMaxCodeLen());
        
        // And the resulting code should start with "X"
        assertEquals("X", encode);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEncodeTakingString5() throws Throwable  {
        // rollbacked to evosuite
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        String encode = doubleMetaphone.encode("SCHED<1WW{b:50~G");
        assertEquals("SKTP", encode);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsDoubleMetaphoneEqualTaking2ArgumentsAndIsDoubleMetaphoneEqualTaking2ArgumentsReturningFalse0() throws Throwable  {
        // Create a DoubleMetaphone object to test
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        
        // Test that the method returns false when passed two strings with different phonemes
        String string1 = "blacqW%~HgN,";
        String string2 = "ScZpePh=^(O";
        boolean doubleMetaphoneEqual = doubleMetaphone.isDoubleMetaphoneEqual(string1, string2);
        assertFalse(doubleMetaphoneEqual);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsDoubleMetaphoneEqualTaking2ArgumentsAndIsDoubleMetaphoneEqualTaking2ArgumentsReturningFalse1() throws Throwable  {
        // Given
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        String word1 = "PSZ";
        String word2 = "PASSE";
        
        // When
        boolean isDoubleMetaphoneEqual = doubleMetaphone.isDoubleMetaphoneEqual(word1, word2);
        
        // Then
        assertFalse(isDoubleMetaphoneEqual);
        assertEquals(4, doubleMetaphone.getMaxCodeLen());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsDoubleMetaphoneEqualTaking2ArgumentsAndIsDoubleMetaphoneEqualTaking2ArgumentsReturningFalse2() throws Throwable  {
        // Given
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        String actualWord1 = "NJPT";
        String actualWord2 = "SUGAR";
        
        // When
        boolean isDoubleMetaphoneEqual = doubleMetaphone.isDoubleMetaphoneEqual(actualWord1, actualWord2);
        
        // Then
        assertFalse(isDoubleMetaphoneEqual);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEncodeTakingString6() throws Throwable  {
        // Tests the encoding of the Double Metaphone algorithm for a given input string
        // Creates an instance of the DoubleMetaphone class
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        
        // Encodes the input string using the DoubleMetaphone algorithm
        String encode = doubleMetaphone.encode("RRKP");
        
        // Asserts that the encoded string is equal to "RKP"
        assertEquals("RKP", encode);
        
        // Asserts that the maximum length of the code is 4
        assertEquals(4, doubleMetaphone.getMaxCodeLen());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEncodeTakingString7() throws Throwable  {
        // No Comments were added
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        String encode = doubleMetaphone.encode("sier");
        assertEquals("S", encode);
        assertEquals(4, doubleMetaphone.getMaxCodeLen());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsDoubleMetaphoneEqualTaking2ArgumentsAndIsDoubleMetaphoneEqualTaking2ArgumentsReturningTrue2() throws Throwable  {
        // Create an instance of DoubleMetaphone
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        
        // Test if "WR" and "WR" are considered equal using the isDoubleMetaphoneEqual method
        assertTrue(doubleMetaphone.isDoubleMetaphoneEqual("WR", "WR"));
        
        // Test if the maximum length of the code is 4
        assertEquals(4, doubleMetaphone.getMaxCodeLen());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsDoubleMetaphoneEqualTaking2ArgumentsAndIsDoubleMetaphoneEqualTaking2ArgumentsReturningFalse3() throws Throwable  {
        // Create a new instance of DoubleMetaphone
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        
        // Check if the given words are equal in terms of their Double Metaphone codes
        boolean isEqual = doubleMetaphone.isDoubleMetaphoneEqual("blac", "sophie");
        
        // Assert that the given words are not equal
        assertFalse(isEqual);
        
        // Get the maximum length of the generated Double Metaphone code
        int maxCodeLen = doubleMetaphone.getMaxCodeLen();
        
        // Assert that the maximum length is 4
        assertEquals(4, maxCodeLen);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEncodeTakingString8() throws Throwable  {
        // Given a string "iJOS*E"
        String inputString = "iJOS*E";
        
        // When the method DoubleMetaphone#encode is called with the string
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        String encode = doubleMetaphone.encode(inputString);
        
        // Then the output should be "AJS"
        assertEquals("AJS", encode);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsDoubleMetaphoneEqualTaking3Arguments1() throws Throwable  {
        // Given
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        String expectedName = "Pizza";
        boolean isValidInput = true;
        
        // When
        boolean doubleMetaphoneEqual = doubleMetaphone.isDoubleMetaphoneEqual("~e_zz[pY4sJWOJt", expectedName, isValidInput);
        
        // Then
        assertFalse(doubleMetaphoneEqual);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsDoubleMetaphoneEqualTaking2ArgumentsAndIsDoubleMetaphoneEqualTaking2ArgumentsReturningFalse4() throws Throwable  {
        // Given the input word "Lavender"
        String inputWord = "Lavender";
        
        // When we apply the Double Metaphone algorithm to the input word
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        boolean doubleMetaphoneEqual = doubleMetaphone.isDoubleMetaphoneEqual(inputWord, "@L~V1r,0HY,aJJ,),q>");
        
        // Then we expect the algorithm to return false, since the input word is not a perfect match for the given code
        assertFalse(doubleMetaphoneEqual);
        
        // Additionally, we expect the length of the returned code to be 4
        assertEquals(4, doubleMetaphone.getMaxCodeLen());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsDoubleMetaphoneEqualTaking2ArgumentsAndIsDoubleMetaphoneEqualTaking2ArgumentsReturningTrue3() throws Throwable  {
        // Test that the double metaphone algorithm returns true when comparing two equal strings
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        assertTrue(doubleMetaphone.isDoubleMetaphoneEqual("GNJOSE", "GNJOSE"));
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEncodeTakingString9() throws Throwable  {
        // Arrange
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        
        // Act
        String encode = doubleMetaphone.encode("DE:uGho)%hILo[{");
        
        // Assert
        assertEquals(4, doubleMetaphone.getMaxCodeLen());
        assertEquals("TKL", encode);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsDoubleMetaphoneEqualTaking2ArgumentsAndIsDoubleMetaphoneEqualTaking2ArgumentsReturningFalse5() throws Throwable  {
        // Arrange
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        
        // Act
        boolean doubleMetaphoneEqual = doubleMetaphone.isDoubleMetaphoneEqual("IGhhA.fKPW", "KNSIAN");
        
        // Assert
        assertEquals(4, doubleMetaphone.getMaxCodeLen());
        assertFalse(doubleMetaphoneEqual);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsDoubleMetaphoneEqualTaking2ArgumentsAndIsDoubleMetaphoneEqualTaking2ArgumentsReturningFalse6() throws Throwable  {
        // Given two strings, "Nght" and "NGh%&", that are not equal in length
        String str1 = "Nght";
        String str2 = "NGh%&";
        
        // When we pass these strings to the DoubleMetaphone class's isDoubleMetaphoneEqual method
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        boolean doubleMetaphoneEqual = doubleMetaphone.isDoubleMetaphoneEqual(str1, str2);
        
        // Then we expect the method to return false
        assertFalse(doubleMetaphoneEqual);
        
        // And also expect the getMaxCodeLen method to return 4
        assertEquals(4, doubleMetaphone.getMaxCodeLen());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEncodeTakingString10() throws Throwable  {
        // This test case checks that the encode method of the DoubleMetaphone class returns the expected result for a given input string.
        
        // Set up the test data: create an instance of the DoubleMetaphone class and the input string to be encoded.
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        String inputString = "Me=hkFgG@lk4+9";
        
        // Execute the code under test: call the encode method on the DoubleMetaphone instance with the input string.
        String encodedString = doubleMetaphone.encode(inputString);
        
        // Verify the results: assert that the result of encoding the input string is as expected.
        assertEquals("MKFK", encodedString);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEncodeTakingString11() throws Throwable  {
        // Test case for the DoubleMetaphone class
        // Create a new instance of the DoubleMetaphone class
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        
        // Encode a string with "Ch"
        String encodedString = doubleMetaphone.encode("Ch");
        
        // Assert that the encoded string is equal to "K"
        assertEquals("K", encodedString);
        
        // Assert that the maximum code length is 4
        assertEquals(4, doubleMetaphone.getMaxCodeLen());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsDoubleMetaphoneEqualTaking2ArgumentsAndIsDoubleMetaphoneEqualTaking2ArgumentsReturningFalse7() throws Throwable  {
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        
        // Given two words, "WATCH" and "WARCH", that have different Double Metaphone codes
        String word1 = "WATCH";
        String word2 = "WARCH";
        
        // When the isDoubleMetaphoneEqual method is called with these two words as arguments
        boolean doubleMetaphoneEqual = doubleMetaphone.isDoubleMetaphoneEqual(word1, word2);
        
        // Then the method should return false because the Double Metaphone codes for these two words are different
        assertFalse(doubleMetaphoneEqual);
        
        // Also, the max code length of the Double Metaphone code for "WATCH" is 4
        assertEquals(4, doubleMetaphone.getMaxCodeLen());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEncodeTakingString12() throws Throwable  {
        // Given a DoubleMetaphone instance
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        
        // And a name to encode
        String nameToEncode = "Michael";
        
        // When the encode method is called with the name
        String encodedValue = doubleMetaphone.encode(nameToEncode);
        
        // Then the encoded value should be correct
        assertEquals("MKL", encodedValue);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEncodeTakingString13() throws Throwable  {
        // Given
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        
        // When
        String encode = doubleMetaphone.encode("hockey");
        
        // Then
        assertEquals("HK", encode);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEncodeTakingString14() throws Throwable  {
        // Given
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        String input = "*CCES";
        
        // When
        String encode = doubleMetaphone.encode(input);
        
        // Then
        assertEquals("XS", encode);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEncodeTakingObjectReturningNonNull() throws Throwable  {
        // Arrange
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        
        // Act
        Object encode = doubleMetaphone.encode("Charles");
        
        // Assert
        assertEquals("XRLS", encode);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEncodeTakingObjectThrowsException() throws Throwable  {
        // Given: A DoubleMetaphone class that takes a string as input and returns a double metaphone key.
        // When: The encode method is called with an object as input instead of a string.
        // Then: An exception should be thrown indicating that the parameter is not of type String.
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        Object arg0 = new Object();
        try {
        doubleMetaphone.encode(arg0);
        fail("Expecting exception: Exception");
        
        } catch(Exception e) {
        //
        // Verify that the expected exception is thrown with a message indicating that the parameter is not of type String.
        //
        verifyException("org.apache.commons.codec.language.DoubleMetaphone", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEncodeTakingString15() throws Throwable  {
        // Given a string "g" to be encoded
        String input = "g";
        
        // When the string is passed to the DoubleMetaphone encode method
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        String encode = doubleMetaphone.encode(input);
        
        // Then the encode method should return a non-null value
        assertNotNull(encode);
        
        // And the returned string should have a maximum length of 4 characters
        assertEquals(4, encode.length());
        
        // And the returned string should be equal to "K"
        assertEquals("K", encode);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEncodeTakingStringReturningNull() throws Throwable  {
        // This test verifies that the DoubleMetaphone class is able to encode a string and return its encoding.
        // The test also checks the maximum length of the code returned by the encode method.
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        String encode = doubleMetaphone.encode("");
        assertEquals(4, doubleMetaphone.getMaxCodeLen());
        assertNull(encode);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetMaxCodeLenWithPositive() throws Throwable  {
        // No Comments were added
        DoubleMetaphone doubleMetaphone = new DoubleMetaphone();
        doubleMetaphone.setMaxCodeLen(9);
        boolean doubleMetaphoneEqual = doubleMetaphone.isDoubleMetaphoneEqual("o40:NW_Z'l?(glI", "WqU;hXCf4");
        assertEquals(9, doubleMetaphone.getMaxCodeLen());
        assertFalse(doubleMetaphoneEqual);
    }
  }
  