content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Mon Mar 18 16:09:26 GMT 2024
   */
  
  package org.apache.commons.lang3.time;
  
  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 java.text.FieldPosition;
  import java.text.ParsePosition;
  import java.util.Calendar;
  import java.util.Date;
  import java.util.Locale;
  import java.util.SimpleTimeZone;
  import java.util.TimeZone;
  import org.apache.commons.lang3.time.FastDateFormat;
  import org.evosuite.runtime.EvoRunner;
  import org.evosuite.runtime.EvoRunnerParameters;
  import org.evosuite.runtime.mock.java.util.MockDate;
  import org.evosuite.runtime.mock.java.util.MockGregorianCalendar;
  import org.junit.runner.RunWith;
  
  @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
  public class FastDateFormat_Original_ESTest extends FastDateFormat_Original_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesFastDateFormatTaking4Arguments() throws Throwable  {
        SimpleTimeZone arg1 = new SimpleTimeZone(1345, "`_6z");
        Locale arg2 = Locale.GERMANY;
        MockDate arg3 = new MockDate(1345, 0, 1345, 2, 1345);
        FastDateFormat fastDateFormat = new FastDateFormat("`_6z", arg1, arg2, arg3);
        assertEquals(2, FastDateFormat.MEDIUM);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseObjectReturningNull() throws Throwable  {
        FastDateFormat instance = FastDateFormat.getInstance();
        ParsePosition arg1 = new ParsePosition(3);
        Object parseObject = instance.parseObject("5/v", arg1);
        assertNull(parseObject);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetTimeZoneReturningTimeZoneWhereGetRawOffsetIsZero() throws Throwable  {
        SimpleTimeZone arg1 = new SimpleTimeZone(0, "");
        FastDateFormat dateInstance = FastDateFormat.getDateInstance(0, (TimeZone) arg1);
        TimeZone timeZone = dateInstance.getTimeZone();
        assertSame(timeZone, arg1);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetInstanceTaking1And1AndGetInstanceTaking1And1AndGetInstanceTaking1And1ReturningNonNull0() throws Throwable  {
        TimeZone arg1 = TimeZone.getTimeZone("43D");
        FastDateFormat instance = FastDateFormat.getInstance("43D", arg1);
        assertEquals(2, FastDateFormat.MEDIUM);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetDateTimeInstanceTaking4Arguments() throws Throwable  {
        Locale arg3 = Locale.CHINESE;
        TimeZone arg2 = TimeZone.getTimeZone("");
        FastDateFormat dateTimeInstance = FastDateFormat.getDateTimeInstance(0, 2, arg2, arg3);
        assertEquals(3, FastDateFormat.SHORT);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsReturningFalse() throws Throwable  {
        FastDateFormat instance = FastDateFormat.getInstance();
        boolean equals = instance.equals((Object) null);
        assertFalse(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsReturningTrue() throws Throwable  {
        FastDateFormat arg0 = FastDateFormat.getInstance();
        boolean equals = arg0.equals(arg0);
        assertTrue(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testFormatTakingDate() throws Throwable  {
        FastDateFormat instance = FastDateFormat.getInstance();
        MockDate arg0 = new MockDate(543L);
        String format = instance.format((Date) arg0);
        assertEquals("1/1/70 12:00 AM", format);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testFormatTaking1And1AndFormatTaking1And1AndFormatTaking1And1ReturningStringBufferWhereLengthIsPositive0() throws Throwable  {
        FastDateFormat instance = FastDateFormat.getInstance();
        StringBuffer arg1 = new StringBuffer();
        StringBuffer format = instance.format((long) 1, arg1);
        assertEquals(15, format.length());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testFormatTakingLong() throws Throwable  {
        FastDateFormat instance = FastDateFormat.getInstance();
        String format = instance.format((long) 2);
        assertEquals("1/1/70 12:00 AM", format);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetInstanceTakingString() throws Throwable  {
        FastDateFormat instance = FastDateFormat.getInstance("?&49");
        ParsePosition arg1 = new ParsePosition(0);
        Date parse = instance.parse("?&49", arg1);
        assertEquals("Fri Feb 14 20:21:21 GMT 2014", parse.toString());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetTimeInstanceTaking3Arguments() throws Throwable  {
        Locale arg2 = Locale.KOREA;
        FastDateFormat timeInstance = FastDateFormat.getTimeInstance(1, (TimeZone) null, arg2);
        assertEquals(0, FastDateFormat.FULL);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetDateTimeInstanceTaking2IntsAnd1AndGetDateTimeInstanceTaking2IntsAnd10() throws Throwable  {
        FastDateFormat dateTimeInstance = FastDateFormat.getDateTimeInstance(2, 2, (TimeZone) null);
        assertEquals(1, FastDateFormat.LONG);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testFormatTakingCalendar() throws Throwable  {
        FastDateFormat instance = FastDateFormat.getInstance();
        MockGregorianCalendar arg0 = new MockGregorianCalendar();
        String format = instance.format((Calendar) arg0);
        assertEquals("2/14/14 8:21 PM", format);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testFormatTaking3Arguments() throws Throwable  {
        FastDateFormat instance = FastDateFormat.getInstance();
        MockGregorianCalendar arg0 = new MockGregorianCalendar();
        StringBuffer arg1 = new StringBuffer();
        FieldPosition arg2 = new FieldPosition(3);
        StringBuffer format = instance.format((Object) arg0, arg1, arg2);
        assertSame(format, arg1);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetDateInstanceTaking3Arguments() throws Throwable  {
        Locale arg2 = Locale.TAIWAN;
        FastDateFormat dateInstance = FastDateFormat.getDateInstance(1, (TimeZone) null, arg2);
        assertEquals(3, FastDateFormat.SHORT);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testApplyRules() throws Throwable  {
        FastDateFormat instance = FastDateFormat.getInstance();
        MockGregorianCalendar arg0 = new MockGregorianCalendar();
        StringBuffer arg1 = new StringBuffer();
        StringBuffer applyRules = instance.applyRules(arg0, arg1);
        assertEquals(15, applyRules.length());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testFailsToCreateFastDateFormatTaking3ArgumentsThrowsNullPointerException() throws Throwable  {
        SimpleTimeZone arg1 = new SimpleTimeZone(3, "");
        FastDateFormat fastDateFormat = null;
        try {
          fastDateFormat = new FastDateFormat(",", arg1, (Locale) null);
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetInstanceTaking1And1ThrowsStringIndexOutOfBoundsException() throws Throwable  {
        // Undeclared exception!
        try { 
          FastDateFormat.getInstance("", (TimeZone) null);
          fail("Expecting exception: StringIndexOutOfBoundsException");
        
        } catch(StringIndexOutOfBoundsException e) {
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetTimeInstanceTaking1And1AndGetTimeInstanceTaking1And1() throws Throwable  {
        Locale arg1 = Locale.SIMPLIFIED_CHINESE;
        FastDateFormat timeInstance = FastDateFormat.getTimeInstance(1, arg1);
        assertEquals(3, FastDateFormat.SHORT);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetTimeZoneReturningTimeZoneWhereGetRawOffsetIsNegative() throws Throwable  {
        SimpleTimeZone arg1 = new SimpleTimeZone((-733), "");
        FastDateFormat dateInstance = FastDateFormat.getDateInstance(0, (TimeZone) arg1);
        TimeZone timeZone = dateInstance.getTimeZone();
        assertSame(timeZone, arg1);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetInstanceTaking1And1AndGetInstanceTaking1And1AndGetInstanceTaking1And1ReturningNonNull1() throws Throwable  {
        Locale arg1 = Locale.UK;
        FastDateFormat instance = FastDateFormat.getInstance(",", arg1);
        assertEquals(2, FastDateFormat.MEDIUM);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHashCode() throws Throwable  {
        FastDateFormat instance = FastDateFormat.getInstance();
        instance.hashCode();
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetDateTimeInstanceTaking2IntsAnd1AndGetDateTimeInstanceTaking2IntsAnd11() throws Throwable  {
        Locale arg2 = Locale.CHINA;
        FastDateFormat dateTimeInstance = FastDateFormat.getDateTimeInstance(0, 1, arg2);
        assertEquals(2, FastDateFormat.MEDIUM);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testFormatTaking1And1AndFormatTaking1And1AndFormatTaking1And1ReturningStringBufferWhereLengthIsPositive1() throws Throwable  {
        FastDateFormat instance = FastDateFormat.getInstance();
        MockGregorianCalendar arg0 = new MockGregorianCalendar(1, 2, 3, 0, 3);
        StringBuffer arg1 = new StringBuffer();
        StringBuffer format = instance.format((Calendar) arg0, arg1);
        assertSame(format, arg1);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetDateInstanceTakingInt() throws Throwable  {
        FastDateFormat dateInstance = FastDateFormat.getDateInstance(0);
        assertEquals(1, FastDateFormat.LONG);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testFormatTaking1And1AndFormatTaking1And1AndFormatTaking1And1ReturningStringBufferWhereLengthIsPositive2() throws Throwable  {
        FastDateFormat instance = FastDateFormat.getInstance();
        MockDate arg0 = new MockDate(0, 0, 1, (-1534), 0);
        StringBuffer arg1 = new StringBuffer("");
        StringBuffer format = instance.format((Date) arg0, arg1);
        assertSame(format, arg1);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetMaxLengthEstimate() throws Throwable  {
        FastDateFormat instance = FastDateFormat.getInstance();
        int maxLengthEstimate = instance.getMaxLengthEstimate();
        assertEquals(21, maxLengthEstimate);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testToString() throws Throwable  {
        FastDateFormat instance = FastDateFormat.getInstance();
        String string = instance.toString();
        assertEquals("FastDateFormat[M/d/yy h:mm a,en,GMT]", string);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetLocale() throws Throwable  {
        FastDateFormat instance = FastDateFormat.getInstance();
        Locale locale = instance.getLocale();
        assertEquals("eng", locale.getISO3Language());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseObjectReturningNonNull() throws Throwable  {
        FastDateFormat instance = FastDateFormat.getInstance();
        ParsePosition arg1 = new ParsePosition(0);
        Object parseObject = instance.parseObject("2/14/14 8:21 PM", arg1);
        assertEquals("Fri Feb 14 20:21:21 GMT 2014", parseObject.toString());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetTimeInstanceTaking1And1AndGetTimeZone() throws Throwable  {
        SimpleTimeZone arg1 = new SimpleTimeZone(1, "u:b!a}I\u0002tr+sG>S`]", 1, 1, 1, 1, 1, 1, 1, 1);
        FastDateFormat timeInstance = FastDateFormat.getTimeInstance(1, (TimeZone) arg1);
        TimeZone timeZone = timeInstance.getTimeZone();
        assertSame(timeZone, arg1);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetDateTimeInstanceTaking2Arguments() throws Throwable  {
        FastDateFormat dateTimeInstance = FastDateFormat.getDateTimeInstance(0, 0);
        ParsePosition arg1 = new ParsePosition(0);
        Date parse = dateTimeInstance.parse("^aSvO'A8", arg1);
        assertNull(parse);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetPattern() throws Throwable  {
        FastDateFormat instance = FastDateFormat.getInstance();
        String pattern = instance.getPattern();
        assertEquals("M/d/yy h:mm a", pattern);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetTimeInstanceTakingIntAndParseTakingString() throws Throwable  {
        FastDateFormat timeInstance = FastDateFormat.getTimeInstance(0);
        Date parse = timeInstance.parse("11:59:59 PM GMT");
        assertEquals("Fri Feb 14 20:21:21 GMT 2014", parse.toString());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetDateInstanceTaking1And1AndGetInstanceTaking3Arguments() throws Throwable  {
        Locale arg2 = Locale.ROOT;
        FastDateFormat dateInstance = FastDateFormat.getDateInstance(0, arg2);
        TimeZone arg1 = dateInstance.getTimeZone();
        FastDateFormat instance = FastDateFormat.getInstance("a", arg1, arg2);
        assertEquals(2, FastDateFormat.MEDIUM);
    }
  }
  