content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Mon Mar 18 03:48:34 GMT 2024
   */
  
  package org.apache.lucene.search.exposed.compare;
  
  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 com.ibm.icu.text.Collator;
  import java.util.Locale;
  import org.apache.lucene.search.exposed.compare.NamedCollatorComparator;
  import org.apache.lucene.util.BytesRef;
  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 NamedCollatorComparator_Original_ESTest extends NamedCollatorComparator_Original_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetIDReturningNull() throws Throwable  {
        NamedCollatorComparator namedCollatorComparator = new NamedCollatorComparator((Collator) null, (String) null);
        namedCollatorComparator.getID();
        assertFalse(namedCollatorComparator.isReverse());
        assertFalse(namedCollatorComparator.isNullFirst());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetIDReturningNonEmptyString() throws Throwable  {
        NamedCollatorComparator namedCollatorComparator = new NamedCollatorComparator((Collator) null, "-]y_(V<ZJI");
        namedCollatorComparator.getID();
        assertFalse(namedCollatorComparator.isReverse());
        assertFalse(namedCollatorComparator.isNullFirst());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsReverseReturningTrue() throws Throwable  {
        NamedCollatorComparator namedCollatorComparator = new NamedCollatorComparator((Collator) null, "");
        assertFalse(namedCollatorComparator.isReverse());
        
        namedCollatorComparator.setReverse(true);
        boolean reverse = namedCollatorComparator.isReverse();
        assertTrue(reverse);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetReverseWithFalse() throws Throwable  {
        NamedCollatorComparator namedCollatorComparator = new NamedCollatorComparator((Collator) null, "");
        namedCollatorComparator.setReverse(false);
        assertFalse(namedCollatorComparator.isReverse());
        assertFalse(namedCollatorComparator.isNullFirst());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetNullFirstAndCompareReturningPositive() throws Throwable  {
        BytesRef arg0 = new BytesRef(1);
        NamedCollatorComparator namedCollatorComparator = new NamedCollatorComparator((Collator) null, "))");
        assertFalse(namedCollatorComparator.isNullFirst());
        
        namedCollatorComparator.setNullFirst(true);
        int compare = namedCollatorComparator.compare(arg0, (BytesRef) null);
        assertTrue(namedCollatorComparator.isNullFirst());
        assertEquals(1, compare);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCompareThrowsNullPointerException() throws Throwable  {
        NamedCollatorComparator namedCollatorComparator = new NamedCollatorComparator((Collator) null, (String) null);
        BytesRef arg1 = new BytesRef();
        // Undeclared exception!
        try { 
          namedCollatorComparator.compare(arg1, arg1);
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.apache.lucene.search.exposed.compare.NamedCollatorComparator", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetNullFirstAndCompareReturningNegative() throws Throwable  {
        BytesRef arg1 = new BytesRef(1);
        NamedCollatorComparator namedCollatorComparator = new NamedCollatorComparator((Collator) null, "))");
        assertFalse(namedCollatorComparator.isNullFirst());
        
        namedCollatorComparator.setNullFirst(true);
        int compare = namedCollatorComparator.compare((BytesRef) null, arg1);
        assertTrue(namedCollatorComparator.isNullFirst());
        assertEquals((-1), compare);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCompareReturningPositive() throws Throwable  {
        BytesRef arg1 = new BytesRef(1);
        NamedCollatorComparator namedCollatorComparator = new NamedCollatorComparator((Collator) null, "))");
        int compare = namedCollatorComparator.compare((BytesRef) null, arg1);
        assertFalse(namedCollatorComparator.isReverse());
        assertEquals(1, compare);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCompareReturningZero() throws Throwable  {
        NamedCollatorComparator namedCollatorComparator = new NamedCollatorComparator((Collator) null, (String) null);
        int compare = namedCollatorComparator.compare((BytesRef) null, (BytesRef) null);
        assertFalse(namedCollatorComparator.isReverse());
        assertEquals(0, compare);
        assertFalse(namedCollatorComparator.isNullFirst());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCompareReturningNegative() throws Throwable  {
        BytesRef arg0 = new BytesRef(1);
        NamedCollatorComparator namedCollatorComparator = new NamedCollatorComparator((Collator) null, "))");
        int compare = namedCollatorComparator.compare(arg0, (BytesRef) null);
        assertEquals((-1), compare);
        assertFalse(namedCollatorComparator.isReverse());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesNamedCollatorComparatorTakingLocale() throws Throwable  {
        Locale arg0 = Locale.JAPANESE;
        NamedCollatorComparator namedCollatorComparator = new NamedCollatorComparator(arg0);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testFailsToCreateNamedCollatorComparatorTakingCollatorThrowsNullPointerException() throws Throwable  {
        NamedCollatorComparator namedCollatorComparator = null;
        try {
          namedCollatorComparator = new NamedCollatorComparator((Collator) null);
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.evosuite.runtime.System", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsNullFirstReturningTrue() throws Throwable  {
        NamedCollatorComparator namedCollatorComparator = new NamedCollatorComparator((Collator) null, "D/*^#ojfHqP#']");
        assertFalse(namedCollatorComparator.isNullFirst());
        
        namedCollatorComparator.setNullFirst(true);
        boolean nullFirst = namedCollatorComparator.isNullFirst();
        assertTrue(nullFirst);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetIDReturningEmptyString() throws Throwable  {
        NamedCollatorComparator namedCollatorComparator = new NamedCollatorComparator((Collator) null, "");
        namedCollatorComparator.getID();
        assertFalse(namedCollatorComparator.isNullFirst());
        assertFalse(namedCollatorComparator.isReverse());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetCollator() throws Throwable  {
        NamedCollatorComparator namedCollatorComparator = new NamedCollatorComparator((Collator) null, "))");
        namedCollatorComparator.getCollator();
        assertFalse(namedCollatorComparator.isReverse());
        assertFalse(namedCollatorComparator.isNullFirst());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetCollationKeyTakingStringThrowsNullPointerException() throws Throwable  {
        NamedCollatorComparator namedCollatorComparator = new NamedCollatorComparator((Collator) null, "5");
        // Undeclared exception!
        try { 
          namedCollatorComparator.getCollationKey("5");
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.apache.lucene.search.exposed.compare.NamedCollatorComparator", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsReverseReturningFalse() throws Throwable  {
        NamedCollatorComparator namedCollatorComparator = new NamedCollatorComparator((Collator) null, "");
        boolean reverse = namedCollatorComparator.isReverse();
        assertFalse(reverse);
        assertFalse(namedCollatorComparator.isNullFirst());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetCollationKeyTakingBytesRefThrowsNullPointerException() throws Throwable  {
        NamedCollatorComparator namedCollatorComparator = new NamedCollatorComparator((Collator) null, "&8U??kp6^j7S@ Zb");
        BytesRef arg0 = new BytesRef();
        // Undeclared exception!
        try { 
          namedCollatorComparator.getCollationKey(arg0);
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.apache.lucene.search.exposed.compare.NamedCollatorComparator", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetOrder() throws Throwable  {
        NamedCollatorComparator namedCollatorComparator = new NamedCollatorComparator((Collator) null, "");
        namedCollatorComparator.getOrder();
        assertFalse(namedCollatorComparator.isReverse());
        assertFalse(namedCollatorComparator.isNullFirst());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsNullFirstReturningFalse() throws Throwable  {
        NamedCollatorComparator namedCollatorComparator = new NamedCollatorComparator((Collator) null, "D/*^#ojfHqP#']");
        boolean nullFirst = namedCollatorComparator.isNullFirst();
        assertFalse(nullFirst);
        assertFalse(namedCollatorComparator.isReverse());
    }
  }
  