content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Wed Mar 20 06:54:16 GMT 2024
   */
  
  package org.joda.time.format;
  
  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.io.CharArrayWriter;
  import java.io.Writer;
  import java.util.LinkedList;
  import java.util.Locale;
  import org.evosuite.runtime.EvoRunner;
  import org.evosuite.runtime.EvoRunnerParameters;
  import org.evosuite.runtime.mock.java.io.MockFileWriter;
  import org.joda.time.Days;
  import org.joda.time.Hours;
  import org.joda.time.LocalTime;
  import org.joda.time.Minutes;
  import org.joda.time.Months;
  import org.joda.time.MutablePeriod;
  import org.joda.time.Period;
  import org.joda.time.PeriodType;
  import org.joda.time.ReadWritablePeriod;
  import org.joda.time.ReadablePeriod;
  import org.joda.time.Weeks;
  import org.joda.time.Years;
  import org.joda.time.format.PeriodFormatter;
  import org.joda.time.format.PeriodFormatterBuilder;
  import org.joda.time.format.PeriodParser;
  import org.joda.time.format.PeriodPrinter;
  import org.junit.runner.RunWith;
  
  @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
  public class PeriodFormatterBuilder_Original_ESTest extends PeriodFormatterBuilder_Original_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrintToTaking1And1AndPrintToTaking1And1AndCreatesSimpleAffixTakingString() throws Throwable  {
        PeriodFormatterBuilder.SimpleAffix periodFormatterBuilder_SimpleAffix = new PeriodFormatterBuilder.SimpleAffix("below the supported minimum of ");
        StringBuffer arg0 = new StringBuffer(23118750);
        periodFormatterBuilder_SimpleAffix.printTo(arg0, 23118750);
        assertEquals(31, arg0.length());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrintToTaking1And1() throws Throwable  {
        PeriodFormatterBuilder.SimpleAffix periodFormatterBuilder_SimpleAffix = new PeriodFormatterBuilder.SimpleAffix("rSTr45?%c8C4:03P)|");
        // Undeclared exception!
        try { 
          periodFormatterBuilder_SimpleAffix.printTo((Writer) null, (-1138));
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.joda.time.format.PeriodFormatterBuilder$SimpleAffix", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseAndParse() throws Throwable  {
        PeriodFormatterBuilder.SimpleAffix periodFormatterBuilder_SimpleAffix = new PeriodFormatterBuilder.SimpleAffix("org.!oda.time.format.PeriodFormattrBuilder$Literal");
        int parse = periodFormatterBuilder_SimpleAffix.parse("org.!oda.time.format.PeriodFormattrBuilder$Literal", 0);
        assertEquals(50, parse);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesSimpleAffixTakingStringAndCallsCalculatePrintedLengthTakingInt() throws Throwable  {
        PeriodFormatterBuilder.SimpleAffix periodFormatterBuilder_SimpleAffix = new PeriodFormatterBuilder.SimpleAffix("");
        int calculatePrintedLength = periodFormatterBuilder_SimpleAffix.calculatePrintedLength(469);
        assertEquals(0, calculatePrintedLength);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseIntoAndParseInto() throws Throwable  {
        PeriodFormatterBuilder.Literal periodFormatterBuilder_Literal = PeriodFormatterBuilder.Literal.EMPTY;
        Locale arg3 = Locale.US;
        MutablePeriod arg0 = new MutablePeriod();
        int parseInto = periodFormatterBuilder_Literal.parseInto(arg0, "ReadableInstant objects must not be null", (-3579), arg3);
        assertEquals(3578, parseInto);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCalculatePrintedLengthTaking2ArgumentsAndCalculatePrintedLengthTaking2Arguments() throws Throwable  {
        PeriodFormatterBuilder.Literal periodFormatterBuilder_Literal = PeriodFormatterBuilder.Literal.EMPTY;
        Weeks arg0 = Weeks.TWO;
        int calculatePrintedLength = periodFormatterBuilder_Literal.calculatePrintedLength(arg0, (Locale) null);
        assertEquals(0, calculatePrintedLength);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrintToTaking11And1AndCreatesFieldFormatterTaking8ArgumentsAndCreatesPluralAffixTaking2Arguments() throws Throwable  {
        PeriodFormatterBuilder.PluralAffix arg7 = new PeriodFormatterBuilder.PluralAffix("", "");
        PeriodFormatterBuilder.FieldFormatter[] arg5 = new PeriodFormatterBuilder.FieldFormatter[0];
        PeriodFormatterBuilder.FieldFormatter periodFormatterBuilder_FieldFormatter = new PeriodFormatterBuilder.FieldFormatter(61, 0, (-86), true, (-86), arg5, arg7, arg7);
        Locale arg2 = Locale.KOREA;
        // Undeclared exception!
        try { 
          periodFormatterBuilder_FieldFormatter.printTo((Writer) null, (ReadablePeriod) null, arg2);
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.joda.time.format.PeriodFormatterBuilder$FieldFormatter", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsZero() throws Throwable  {
        PeriodFormatterBuilder.SimpleAffix arg6 = new PeriodFormatterBuilder.SimpleAffix("jQ4n\"Hg3%");
        PeriodFormatterBuilder.FieldFormatter periodFormatterBuilder_FieldFormatter = new PeriodFormatterBuilder.FieldFormatter(85, 85, 85, false, 85, (PeriodFormatterBuilder.FieldFormatter[]) null, arg6, (PeriodFormatterBuilder.PeriodFieldAffix) null);
        MutablePeriod arg0 = new MutablePeriod(85, (-23), 85, 85);
        boolean zero = periodFormatterBuilder_FieldFormatter.isZero(arg0);
        assertFalse(zero);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesFieldFormatterTaking2Arguments() throws Throwable  {
        PeriodFormatterBuilder.SimpleAffix arg7 = new PeriodFormatterBuilder.SimpleAffix("0:nt>pm ");
        PeriodFormatterBuilder.FieldFormatter arg0 = new PeriodFormatterBuilder.FieldFormatter((-2963), 4, (-2963), true, 4, (PeriodFormatterBuilder.FieldFormatter[]) null, arg7, arg7);
        PeriodFormatterBuilder.PluralAffix arg1 = new PeriodFormatterBuilder.PluralAffix("S/n={", "S/n={");
        PeriodFormatterBuilder.FieldFormatter periodFormatterBuilder_FieldFormatter = new PeriodFormatterBuilder.FieldFormatter(arg0, arg1);
        assertFalse(periodFormatterBuilder_FieldFormatter.equals((Object)arg0));
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testToFormatterReturningPeriodFormatterWhereIsPrinterIsFalse() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        PeriodFormatterBuilder.Literal arg1 = PeriodFormatterBuilder.Literal.EMPTY;
        periodFormatterBuilder.append((PeriodPrinter) null, (PeriodParser) arg1);
        PeriodFormatter formatter = periodFormatterBuilder.toFormatter();
        assertFalse(formatter.isPrinter());
        assertTrue(formatter.isParser());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendMinutes() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        periodFormatterBuilder.appendMinutes();
        PeriodFormatterBuilder.Composite arg4 = (PeriodFormatterBuilder.Composite)periodFormatterBuilder.toPrinter();
        PeriodFormatterBuilder.Separator periodFormatterBuilder_Separator = new PeriodFormatterBuilder.Separator("Y\";]|x&IOQ66", "org.joda.time.format.PeriodFormatterBuilder$Literal", (String[]) null, arg4, arg4, true, false);
        StringBuffer arg0 = new StringBuffer("f");
        Period arg1 = Period.seconds((-1));
        Locale arg2 = Locale.PRC;
        // Undeclared exception!
        try { 
          periodFormatterBuilder_Separator.printTo(arg0, (ReadablePeriod) arg1, arg2);
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.joda.time.format.PeriodFormatterBuilder$Separator", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetFieldValue0() throws Throwable  {
        PeriodFormatterBuilder.PluralAffix arg7 = new PeriodFormatterBuilder.PluralAffix("pb", "Mp{z");
        PeriodFormatterBuilder.FieldFormatter[] arg5 = new PeriodFormatterBuilder.FieldFormatter[0];
        PeriodFormatterBuilder.FieldFormatter periodFormatterBuilder_FieldFormatter = new PeriodFormatterBuilder.FieldFormatter(1549, 1549, 1549, true, 0, arg5, arg7, arg7);
        Years arg0 = Years.THREE;
        long fieldValue = periodFormatterBuilder_FieldFormatter.getFieldValue(arg0);
        assertEquals(3L, fieldValue);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesSeparatorTaking7ArgumentsAndCallsPrintToTaking11And1() throws Throwable  {
        PeriodFormatterBuilder.Literal arg4 = PeriodFormatterBuilder.Literal.EMPTY;
        PeriodFormatterBuilder.Separator periodFormatterBuilder_Separator = new PeriodFormatterBuilder.Separator(")}b@Kqm", ")}b@Kqm", (String[]) null, arg4, arg4, false, false);
        StringBuffer arg0 = new StringBuffer("#Wm");
        // Undeclared exception!
        try { 
          periodFormatterBuilder_Separator.printTo(arg0, (ReadablePeriod) null, (Locale) null);
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.joda.time.format.PeriodFormatterBuilder$Separator", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrintToTaking11And1AndPrintToTaking11And1() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        PeriodFormatterBuilder appendSecondsWithMillis = periodFormatterBuilder.appendSecondsWithMillis();
        PeriodFormatterBuilder appendSeparator = appendSecondsWithMillis.appendSeparator("", "");
        PeriodPrinter printer = appendSeparator.toPrinter();
        StringBuffer arg0 = new StringBuffer();
        Period arg1 = Period.seconds(934);
        Locale arg2 = Locale.PRC;
        printer.printTo(arg0, (ReadablePeriod) arg1, arg2);
        assertEquals(7, arg0.length());
        assertEquals("934.000", arg0.toString());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesSimpleAffixTakingStringAndCallsScan0() throws Throwable  {
        PeriodFormatterBuilder.SimpleAffix arg1 = new PeriodFormatterBuilder.SimpleAffix("jc)h");
        PeriodFormatterBuilder.CompositeAffix periodFormatterBuilder_CompositeAffix = new PeriodFormatterBuilder.CompositeAffix(arg1, arg1);
        int scan = periodFormatterBuilder_CompositeAffix.scan("/9}VmP[}*Y", 0);
        assertEquals((-1), scan);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testScanAndScan() throws Throwable  {
        PeriodFormatterBuilder.SimpleAffix periodFormatterBuilder_SimpleAffix = new PeriodFormatterBuilder.SimpleAffix("org.joda.time.format.PeriodFormatterBuilder$Composite");
        int scan = periodFormatterBuilder_SimpleAffix.scan("org.joda.time.format.PeriodFormatterBuilder$Composite", 8);
        assertEquals((-9), scan);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesSimpleAffixTakingStringAndCallsScan1() throws Throwable  {
        PeriodFormatterBuilder.SimpleAffix arg1 = new PeriodFormatterBuilder.SimpleAffix("rSTr45?%c8C4:03P)|");
        PeriodFormatterBuilder.CompositeAffix periodFormatterBuilder_CompositeAffix = new PeriodFormatterBuilder.CompositeAffix(arg1, arg1);
        int scan = periodFormatterBuilder_CompositeAffix.scan("hk#zF-2Q`C", 5);
        assertEquals((-6), scan);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesSimpleAffixTakingStringAndCallsScan2() throws Throwable  {
        PeriodFormatterBuilder.SimpleAffix arg1 = new PeriodFormatterBuilder.SimpleAffix("0,un}vjfms");
        PeriodFormatterBuilder.CompositeAffix periodFormatterBuilder_CompositeAffix = new PeriodFormatterBuilder.CompositeAffix(arg1, arg1);
        int scan = periodFormatterBuilder_CompositeAffix.scan("0,f3 pJfMs", 0);
        assertEquals((-1), scan);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendTaking2ArgumentsAndAppendSeconds() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        periodFormatterBuilder.appendSeconds();
        PeriodFormatterBuilder.Composite arg1 = (PeriodFormatterBuilder.Composite)periodFormatterBuilder.toPrinter();
        PeriodFormatterBuilder append = periodFormatterBuilder.append((PeriodPrinter) arg1, (PeriodParser) arg1);
        PeriodFormatter formatter = append.toFormatter();
        assertTrue(formatter.isParser());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesCompositeTakingList() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        LinkedList<Object> arg0 = new LinkedList<Object>();
        PeriodFormatterBuilder.Composite arg1 = new PeriodFormatterBuilder.Composite(arg0);
        periodFormatterBuilder.append((PeriodPrinter) arg1, (PeriodParser) arg1);
        PeriodFormatter formatter = periodFormatterBuilder.toFormatter();
        assertTrue(formatter.isParser());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesSimpleAffixTakingStringAndCallsScan3() throws Throwable  {
        PeriodFormatterBuilder.SimpleAffix arg1 = new PeriodFormatterBuilder.SimpleAffix("(=w[V`=U\"8|");
        PeriodFormatterBuilder.CompositeAffix periodFormatterBuilder_CompositeAffix = new PeriodFormatterBuilder.CompositeAffix(arg1, arg1);
        int scan = periodFormatterBuilder_CompositeAffix.scan("1qm`:cak{#09t", 0);
        assertEquals((-1), scan);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrintToTaking11And1AndAppendDays() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        PeriodFormatterBuilder printZeroRarelyFirst = periodFormatterBuilder.printZeroRarelyFirst();
        PeriodFormatterBuilder appendSecondsWithOptionalMillis = printZeroRarelyFirst.appendSecondsWithOptionalMillis();
        appendSecondsWithOptionalMillis.appendDays();
        PeriodPrinter printer = periodFormatterBuilder.toPrinter();
        StringBuffer arg0 = new StringBuffer();
        Locale arg2 = Locale.CANADA_FRENCH;
        Period arg1 = Period.ZERO;
        printer.printTo(arg0, (ReadablePeriod) arg1, arg2);
        assertEquals("0", arg0.toString());
        assertEquals(1, arg0.length());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrintToTaking11And1AndPrintZeroRarelyFirst0() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        PeriodFormatterBuilder printZeroRarelyFirst = periodFormatterBuilder.printZeroRarelyFirst();
        PeriodFormatterBuilder appendSecondsWithOptionalMillis = printZeroRarelyFirst.appendSecondsWithOptionalMillis();
        appendSecondsWithOptionalMillis.appendSecondsWithOptionalMillis();
        PeriodPrinter printer = periodFormatterBuilder.toPrinter();
        StringBuffer arg0 = new StringBuffer();
        Locale arg2 = Locale.CHINESE;
        Period arg1 = new Period(9223372036854775807L, 9223372036854775807L);
        printer.printTo(arg0, (ReadablePeriod) arg1, arg2);
        assertEquals(1, arg0.length());
        assertEquals("0", arg0.toString());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrintToTaking11And1() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        PeriodFormatterBuilder appendSecondsWithOptionalMillis = periodFormatterBuilder.appendSecondsWithOptionalMillis();
        appendSecondsWithOptionalMillis.appendSecondsWithOptionalMillis();
        PeriodPrinter printer = periodFormatterBuilder.toPrinter();
        StringBuffer arg0 = new StringBuffer();
        Locale arg2 = Locale.US;
        Period arg1 = Period.ZERO;
        printer.printTo(arg0, (ReadablePeriod) arg1, arg2);
        assertEquals(1, arg0.length());
        assertEquals("0", arg0.toString());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesCompositeAffixTaking2ArgumentsAndCallsGetFieldValue() throws Throwable  {
        PeriodFormatterBuilder.CompositeAffix arg6 = new PeriodFormatterBuilder.CompositeAffix((PeriodFormatterBuilder.PeriodFieldAffix) null, (PeriodFormatterBuilder.PeriodFieldAffix) null);
        PeriodFormatterBuilder.FieldFormatter periodFormatterBuilder_FieldFormatter = new PeriodFormatterBuilder.FieldFormatter((-232), 1232, 612, false, 2, (PeriodFormatterBuilder.FieldFormatter[]) null, arg6, (PeriodFormatterBuilder.PeriodFieldAffix) null);
        Period arg0 = new Period((long) 2);
        long fieldValue = periodFormatterBuilder_FieldFormatter.getFieldValue(arg0);
        assertEquals(0L, fieldValue);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesSeparatorTaking7ArgumentsAndCallsParseInto() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        periodFormatterBuilder.appendSecondsWithMillis();
        PeriodFormatterBuilder.Composite arg4 = (PeriodFormatterBuilder.Composite)periodFormatterBuilder.toPrinter();
        String[] arg2 = new String[1];
        arg2[0] = "9p4-S;HwJtm'{ZLs";
        PeriodFormatterBuilder.Separator periodFormatterBuilder_Separator = new PeriodFormatterBuilder.Separator("9p4-S;HwJtm'{ZLs", "9p4-S;HwJtm'{ZLs", arg2, arg4, arg4, false, false);
        MutablePeriod arg0 = new MutablePeriod();
        Locale arg3 = Locale.ITALIAN;
        // Undeclared exception!
        try { 
          periodFormatterBuilder_Separator.parseInto(arg0, "Cutover too early. Must be on or after 0001-01-01.", 47, arg3);
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.joda.time.format.PeriodFormatterBuilder$Separator", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseIntoAndParseIntoAndToPrinter() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        PeriodFormatterBuilder appendSecondsWithMillis = periodFormatterBuilder.appendSecondsWithMillis();
        PeriodFormatterBuilder.Composite printer = (PeriodFormatterBuilder.Composite)appendSecondsWithMillis.toPrinter();
        Minutes minutes = Minutes.MAX_VALUE;
        MutablePeriod arg0 = minutes.toMutablePeriod();
        Locale arg3 = Locale.ITALIAN;
        int parseInto = printer.parseInto(arg0, "h]+D_x-'SM7", 6, arg3);
        assertEquals((-7), parseInto);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void test0() throws Throwable  {
        // Undeclared exception!
        try { 
          Hours.parseHours("ph");
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // Invalid format: \"ph\" is malformed at \"h\"
           //
           verifyException("org.joda.time.format.PeriodFormatter", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void test1() throws Throwable  {
        Hours parseHours = Hours.parseHours("p");
        assertEquals(1, parseHours.size());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseIntoAndCreatesFieldFormatterTaking8ArgumentsAndCreatesSimpleAffixTakingString() throws Throwable  {
        PeriodFormatterBuilder.SimpleAffix arg7 = new PeriodFormatterBuilder.SimpleAffix("0:nt>pm ");
        PeriodFormatterBuilder.FieldFormatter periodFormatterBuilder_FieldFormatter = new PeriodFormatterBuilder.FieldFormatter((-2963), 4, (-2963), true, 4, (PeriodFormatterBuilder.FieldFormatter[]) null, arg7, arg7);
        Locale arg3 = Locale.TAIWAN;
        int parseInto = periodFormatterBuilder_FieldFormatter.parseInto((ReadWritablePeriod) null, "org.joda.time.format.PeriodFormatterBuilder$PluralAffix", 4, arg3);
        assertEquals((-5), parseInto);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrintToTaking11And1AndAppendSecondsWithOptionalMillisAndCreatesSeparatorTaking7Arguments() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        periodFormatterBuilder.appendSecondsWithOptionalMillis();
        PeriodFormatterBuilder.Composite arg4 = (PeriodFormatterBuilder.Composite)periodFormatterBuilder.toPrinter();
        String[] arg2 = new String[1];
        arg2[0] = "0";
        PeriodFormatterBuilder.Separator periodFormatterBuilder_Separator = new PeriodFormatterBuilder.Separator("0", "|j3w9WwF", arg2, arg4, arg4, false, false);
        MutablePeriod arg1 = new MutablePeriod((-1183), (-1183), (-1183), Integer.MAX_VALUE, (-1183), (-1183), Integer.MAX_VALUE, Integer.MAX_VALUE);
        MockFileWriter arg0 = new MockFileWriter("0");
        // Undeclared exception!
        try { 
          periodFormatterBuilder_Separator.printTo((Writer) arg0, (ReadablePeriod) arg1, (Locale) null);
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.joda.time.format.PeriodFormatterBuilder$Separator", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrintToTaking11And1AndAppendSecondsWithMillisAndCreatesSeparatorTaking7Arguments() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        PeriodFormatterBuilder appendSecondsWithMillis = periodFormatterBuilder.appendSecondsWithMillis();
        PeriodFormatterBuilder.Composite arg4 = (PeriodFormatterBuilder.Composite)appendSecondsWithMillis.toPrinter();
        PeriodFormatterBuilder.Separator periodFormatterBuilder_Separator = new PeriodFormatterBuilder.Separator("%{bG$3}", "%{bG$3}", (String[]) null, arg4, arg4, true, true);
        StringBuffer arg0 = new StringBuffer();
        Period arg1 = new Period(50, 50, (-1), 653);
        Locale arg2 = Locale.FRENCH;
        // Undeclared exception!
        try { 
          periodFormatterBuilder_Separator.printTo(arg0, (ReadablePeriod) arg1, arg2);
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.joda.time.format.PeriodFormatterBuilder$Separator", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrintToTaking11And1AndPrintToTaking11And1AndCreatesFieldFormatterTaking8Arguments() throws Throwable  {
        PeriodFormatterBuilder.PluralAffix arg7 = new PeriodFormatterBuilder.PluralAffix("", "kqmq>X}7UB4:phGN`H");
        PeriodFormatterBuilder.FieldFormatter periodFormatterBuilder_FieldFormatter = new PeriodFormatterBuilder.FieldFormatter(8, 962, 8, true, 8, (PeriodFormatterBuilder.FieldFormatter[]) null, (PeriodFormatterBuilder.PeriodFieldAffix) null, arg7);
        MutablePeriod arg1 = new MutablePeriod(8, 8, 8, (-613));
        Locale arg2 = Locale.KOREA;
        StringBuffer arg0 = new StringBuffer(962);
        periodFormatterBuilder_FieldFormatter.printTo(arg0, (ReadablePeriod) arg1, arg2);
        assertEquals(30, arg0.length());
        assertEquals("00000007.387kqmq>X}7UB4:phGN`H", arg0.toString());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void test2() throws Throwable  {
        Period seconds = Period.seconds((-1));
        String string = seconds.toString();
        assertEquals("PT-1S", string);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCountFieldsToPrint() throws Throwable  {
        PeriodFormatterBuilder.SimpleAffix arg7 = new PeriodFormatterBuilder.SimpleAffix("Mp{z");
        PeriodFormatterBuilder.CompositeAffix arg6 = new PeriodFormatterBuilder.CompositeAffix(arg7, arg7);
        PeriodFormatterBuilder.FieldFormatter periodFormatterBuilder_FieldFormatter = new PeriodFormatterBuilder.FieldFormatter(43, (-1), 532, true, 532, (PeriodFormatterBuilder.FieldFormatter[]) null, arg6, arg7);
        Days arg0 = Days.FOUR;
        Locale arg2 = Locale.US;
        int countFieldsToPrint = periodFormatterBuilder_FieldFormatter.countFieldsToPrint(arg0, (-85), arg2);
        assertEquals(0, countFieldsToPrint);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendSuffixTakingString() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        periodFormatterBuilder.appendSecondsWithOptionalMillis();
        periodFormatterBuilder.appendSuffix("org.joda.time.base.AbstractDateTime");
        PeriodFormatterBuilder appendSuffix = periodFormatterBuilder.appendSuffix("org.joda.time.base.AbstractDateTime");
        assertSame(periodFormatterBuilder, appendSuffix);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesPluralAffixTaking2ArgumentsAndCallsScan0() throws Throwable  {
        PeriodFormatterBuilder.PluralAffix arg1 = new PeriodFormatterBuilder.PluralAffix("org.joda.time.format.DateTimeParserBucket", "ConverterManager.alterPeriodConverters");
        PeriodFormatterBuilder.CompositeAffix periodFormatterBuilder_CompositeAffix = new PeriodFormatterBuilder.CompositeAffix(arg1, arg1);
        int scan = periodFormatterBuilder_CompositeAffix.scan("ConverterManager.alterPeriodConverters", (-2820));
        assertEquals(0, scan);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesPluralAffixTaking2ArgumentsAndCallsScan1() throws Throwable  {
        PeriodFormatterBuilder.PluralAffix arg1 = new PeriodFormatterBuilder.PluralAffix("Pac[ific/Apia", "B=bHT(Hm0~");
        PeriodFormatterBuilder.CompositeAffix periodFormatterBuilder_CompositeAffix = new PeriodFormatterBuilder.CompositeAffix(arg1, arg1);
        int scan = periodFormatterBuilder_CompositeAffix.scan("Pac[ific/Apia", 84);
        assertEquals((-85), scan);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesPluralAffixTaking2ArgumentsAndCallsParse() throws Throwable  {
        PeriodFormatterBuilder.PluralAffix arg1 = new PeriodFormatterBuilder.PluralAffix("", "7K%P\"9K)0)");
        PeriodFormatterBuilder.CompositeAffix periodFormatterBuilder_CompositeAffix = new PeriodFormatterBuilder.CompositeAffix(arg1, arg1);
        int parse = periodFormatterBuilder_CompositeAffix.parse("7K%P\"9K)0)", 0);
        assertEquals(10, parse);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesPluralAffixTaking2ArgumentsAndCallsPrintToTaking1And10() throws Throwable  {
        PeriodFormatterBuilder.PluralAffix periodFormatterBuilder_PluralAffix = new PeriodFormatterBuilder.PluralAffix("orgcKa.tme:.Durion", "orgcKa.tme:.Durion");
        CharArrayWriter arg0 = new CharArrayWriter();
        periodFormatterBuilder_PluralAffix.printTo((Writer) arg0, 1);
        assertEquals("orgcKa.tme:.Durion", arg0.toString());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesPluralAffixTaking2ArgumentsAndCallsPrintToTaking1And11() throws Throwable  {
        PeriodFormatterBuilder.PluralAffix periodFormatterBuilder_PluralAffix = new PeriodFormatterBuilder.PluralAffix("orgjoda.tme.Durion", "orgjoda.tme.Durion");
        CharArrayWriter arg0 = new CharArrayWriter();
        periodFormatterBuilder_PluralAffix.printTo((Writer) arg0, 0);
        assertEquals(18, arg0.size());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrintToTaking1And1AndPrintToTaking1And1() throws Throwable  {
        PeriodFormatterBuilder.PluralAffix periodFormatterBuilder_PluralAffix = new PeriodFormatterBuilder.PluralAffix("", "");
        StringBuffer arg0 = new StringBuffer("");
        periodFormatterBuilder_PluralAffix.printTo(arg0, 1);
        assertEquals(0, arg0.length());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCalculatePrintedLengthTakingIntAndCalculatePrintedLengthTakingInt() throws Throwable  {
        PeriodFormatterBuilder.PluralAffix periodFormatterBuilder_PluralAffix = new PeriodFormatterBuilder.PluralAffix("Builder has created neither a printer nor a parser", "|EkG:#IaX");
        int calculatePrintedLength = periodFormatterBuilder_PluralAffix.calculatePrintedLength(1);
        assertEquals(50, calculatePrintedLength);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesPluralAffixTaking2ArgumentsAndCallsScan2() throws Throwable  {
        PeriodFormatterBuilder.PluralAffix arg1 = new PeriodFormatterBuilder.PluralAffix("[xV)dSO%Ya!|q\"K/Ucp", "[xV)dSO%Ya!|q\"K/Ucp");
        PeriodFormatterBuilder.CompositeAffix periodFormatterBuilder_CompositeAffix = new PeriodFormatterBuilder.CompositeAffix(arg1, arg1);
        int scan = periodFormatterBuilder_CompositeAffix.scan("[xV)dSO%Ya!|q\"K/Ucp", (-3717));
        assertEquals(0, scan);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParse() throws Throwable  {
        PeriodFormatterBuilder.SimpleAffix arg1 = new PeriodFormatterBuilder.SimpleAffix("MpEwaJ:p+7r!LF&");
        PeriodFormatterBuilder.CompositeAffix periodFormatterBuilder_CompositeAffix = new PeriodFormatterBuilder.CompositeAffix(arg1, arg1);
        int parse = periodFormatterBuilder_CompositeAffix.parse("below the supported minimum of ", 0);
        assertEquals((-1), parse);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesSimpleAffixTakingStringAndCallsScan4() throws Throwable  {
        PeriodFormatterBuilder.SimpleAffix arg1 = new PeriodFormatterBuilder.SimpleAffix("3_>7W ZDvY%UmV^q");
        PeriodFormatterBuilder.CompositeAffix periodFormatterBuilder_CompositeAffix = new PeriodFormatterBuilder.CompositeAffix(arg1, arg1);
        int scan = periodFormatterBuilder_CompositeAffix.scan("9>~^}d73O(tK8N!k", 0);
        assertEquals((-1), scan);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void test3() throws Throwable  {
        // Undeclared exception!
        try { 
          Hours.parseHours("p8");
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // Invalid format: \"p8\" is malformed at \"8\"
           //
           verifyException("org.joda.time.format.PeriodFormatter", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesSimpleAffixTakingStringAndCallsScan5() throws Throwable  {
        PeriodFormatterBuilder.SimpleAffix arg1 = new PeriodFormatterBuilder.SimpleAffix("0,uJfM ");
        PeriodFormatterBuilder.CompositeAffix periodFormatterBuilder_CompositeAffix = new PeriodFormatterBuilder.CompositeAffix(arg1, arg1);
        int scan = periodFormatterBuilder_CompositeAffix.scan("xr6Z$ME/][T/WfF-~`Q", 2);
        assertEquals((-3), scan);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesSimpleAffixTakingStringAndCallsScan6() throws Throwable  {
        PeriodFormatterBuilder.SimpleAffix arg1 = new PeriodFormatterBuilder.SimpleAffix("rSTr45?%c8C4:03P)|");
        PeriodFormatterBuilder.CompositeAffix periodFormatterBuilder_CompositeAffix = new PeriodFormatterBuilder.CompositeAffix(arg1, arg1);
        int scan = periodFormatterBuilder_CompositeAffix.scan("rSTr45?%c8C4:03P)|", 5);
        assertEquals((-6), scan);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesSimpleAffixTakingStringAndCallsScan7() throws Throwable  {
        PeriodFormatterBuilder.SimpleAffix arg1 = new PeriodFormatterBuilder.SimpleAffix("rSTr45?%c8C4:03P)|");
        PeriodFormatterBuilder.CompositeAffix periodFormatterBuilder_CompositeAffix = new PeriodFormatterBuilder.CompositeAffix(arg1, arg1);
        int scan = periodFormatterBuilder_CompositeAffix.scan("rSTr45?%c8C4:03P)|", 11);
        assertEquals((-12), scan);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesSimpleAffixTakingStringAndCallsScan8() throws Throwable  {
        PeriodFormatterBuilder.SimpleAffix arg1 = new PeriodFormatterBuilder.SimpleAffix("Pacific/Apia");
        PeriodFormatterBuilder.CompositeAffix periodFormatterBuilder_CompositeAffix = new PeriodFormatterBuilder.CompositeAffix(arg1, arg1);
        int scan = periodFormatterBuilder_CompositeAffix.scan("3r{*l{8xKzE;]$Ido", 0);
        assertEquals((-1), scan);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesSimpleAffixTakingStringAndCallsScan9() throws Throwable  {
        PeriodFormatterBuilder.SimpleAffix arg1 = new PeriodFormatterBuilder.SimpleAffix("below the supported minimum of ");
        PeriodFormatterBuilder.CompositeAffix periodFormatterBuilder_CompositeAffix = new PeriodFormatterBuilder.CompositeAffix(arg1, arg1);
        int scan = periodFormatterBuilder_CompositeAffix.scan("72%&I", 0);
        assertEquals((-1), scan);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testFinish() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        periodFormatterBuilder.appendSecondsWithMillis();
        PeriodFormatterBuilder.Composite arg1 = (PeriodFormatterBuilder.Composite)periodFormatterBuilder.toPrinter();
        Period arg0 = Period.ZERO;
        String[] arg2 = new String[0];
        PeriodFormatterBuilder.Separator periodFormatterBuilder_Separator = new PeriodFormatterBuilder.Separator("l,0i!::1o6>p", "No formatter supplied", arg2, arg1, arg1, true, false);
        periodFormatterBuilder_Separator.finish(arg1, arg1);
        int calculatePrintedLength = periodFormatterBuilder_Separator.calculatePrintedLength(arg0, (Locale) null);
        assertEquals(22, calculatePrintedLength);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendSeparatorTaking3Arguments() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        PeriodFormatterBuilder appendDays = periodFormatterBuilder.appendDays();
        String[] arg2 = new String[0];
        PeriodFormatterBuilder appendSeparator = appendDays.appendSeparator("+Ym,Kx7LC2_tsr[`>b", "'A", arg2);
        assertSame(periodFormatterBuilder, appendSeparator);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetFieldValue() throws Throwable  {
        PeriodFormatterBuilder.PluralAffix arg7 = new PeriodFormatterBuilder.PluralAffix("", "kqmq>X}7UB4:phGN`H");
        MutablePeriod arg0 = new MutablePeriod(0, 0, 55, 55);
        PeriodFormatterBuilder.FieldFormatter[] arg5 = new PeriodFormatterBuilder.FieldFormatter[0];
        PeriodFormatterBuilder.FieldFormatter periodFormatterBuilder_FieldFormatter = new PeriodFormatterBuilder.FieldFormatter(0, 0, (-2168), true, 0, arg5, arg7, arg7);
        periodFormatterBuilder_FieldFormatter.setFieldValue(arg0, 0, (-1));
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testToPrinter() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        periodFormatterBuilder.appendSecondsWithMillis();
        PeriodFormatterBuilder.Composite arg1 = (PeriodFormatterBuilder.Composite)periodFormatterBuilder.toPrinter();
        PeriodFormatter periodFormatter = new PeriodFormatter(arg1, arg1);
        PeriodType arg0 = PeriodType.millis();
        PeriodFormatter withParseType = periodFormatter.withParseType(arg0);
        // Undeclared exception!
        try { 
          withParseType.parsePeriod("z,");
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // Invalid format: \"z,\"
           //
           verifyException("org.joda.time.format.PeriodFormatter", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetFieldValue1() throws Throwable  {
        PeriodFormatterBuilder.PluralAffix arg7 = new PeriodFormatterBuilder.PluralAffix("pb", "Mp{z");
        PeriodFormatterBuilder.FieldFormatter[] arg5 = new PeriodFormatterBuilder.FieldFormatter[0];
        PeriodFormatterBuilder.FieldFormatter periodFormatterBuilder_FieldFormatter = new PeriodFormatterBuilder.FieldFormatter(1549, 1549, 1549, true, 1549, arg5, arg7, arg7);
        Years arg0 = Years.THREE;
        long fieldValue = periodFormatterBuilder_FieldFormatter.getFieldValue(arg0);
        assertEquals(9223372036854775807L, fieldValue);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testToFormatterReturningPeriodFormatterWhereIsParserIsFalse() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        PeriodFormatterBuilder.Literal arg0 = PeriodFormatterBuilder.Literal.EMPTY;
        periodFormatterBuilder.append((PeriodPrinter) arg0, (PeriodParser) null);
        PeriodFormatter formatter = periodFormatterBuilder.toFormatter();
        assertFalse(formatter.isParser());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testToFormatter() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        periodFormatterBuilder.appendSeparatorIfFieldsAfter("org.joda.time.format.PeriodFormatterBuilder$PluralAffix");
        periodFormatterBuilder.toFormatter();
        PeriodFormatter formatter = periodFormatterBuilder.toFormatter();
        assertTrue(formatter.isParser());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testToParserReturningNonNull() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        PeriodFormatterBuilder.Literal arg1 = PeriodFormatterBuilder.Literal.EMPTY;
        PeriodFormatterBuilder append = periodFormatterBuilder.append((PeriodPrinter) null, (PeriodParser) arg1);
        PeriodParser parser = append.toParser();
        assertNotNull(parser);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendSeparatorTaking2ArgumentsWithNonEmptyStringAndNonEmptyString() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        PeriodFormatterBuilder appendSeparatorIfFieldsAfter = periodFormatterBuilder.appendSeparatorIfFieldsAfter("pacificg/apia;]$ido");
        appendSeparatorIfFieldsAfter.appendSecondsWithMillis();
        PeriodFormatterBuilder appendSeparator = appendSeparatorIfFieldsAfter.appendSeparator("pacificg/apia;]$ido", "pacificg/apia;]$ido");
        assertSame(appendSeparator, periodFormatterBuilder);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendSeparatorIfFieldsBeforeThrowsIllegalStateException() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        PeriodFormatterBuilder appendSeparatorIfFieldsAfter = periodFormatterBuilder.appendSeparatorIfFieldsAfter("p,fm");
        // Undeclared exception!
        try { 
          appendSeparatorIfFieldsAfter.appendSeparatorIfFieldsBefore("p,fm");
          fail("Expecting exception: IllegalStateException");
        
        } catch(IllegalStateException e) {
           //
           // Cannot have two adjacent separators
           //
           verifyException("org.joda.time.format.PeriodFormatterBuilder", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendSeparatorTaking3ArgumentsThrowsIllegalArgumentException() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        String[] arg2 = new String[0];
        // Undeclared exception!
        try { 
          periodFormatterBuilder.appendSeparator("rSTr45?%c8C4:03P)|", (String) null, arg2);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.joda.time.format.PeriodFormatterBuilder", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendSeparatorIfFieldsAfter() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        periodFormatterBuilder.appendSeparatorIfFieldsAfter("pm");
        // Undeclared exception!
        try { 
          periodFormatterBuilder.appendSuffix("pm");
          fail("Expecting exception: IllegalStateException");
        
        } catch(IllegalStateException e) {
           //
           // No field to apply suffix to
           //
           verifyException("org.joda.time.format.PeriodFormatterBuilder", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendSuffixTaking2ArgumentsThrowsIllegalArgumentException() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        // Undeclared exception!
        try { 
          periodFormatterBuilder.appendSuffix("n", (String) null);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.joda.time.format.PeriodFormatterBuilder", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendSuffixTaking2ArgumentsWithNull() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        // Undeclared exception!
        try { 
          periodFormatterBuilder.appendSuffix((String) null, (String) null);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.joda.time.format.PeriodFormatterBuilder", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendSuffixTakingStringThrowsIllegalArgumentException() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        // Undeclared exception!
        try { 
          periodFormatterBuilder.appendSuffix((String) null);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.joda.time.format.PeriodFormatterBuilder", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendSuffixTakingStringThrowsIllegalStateException() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        // Undeclared exception!
        try { 
          periodFormatterBuilder.appendSuffix("pm");
          fail("Expecting exception: IllegalStateException");
        
        } catch(IllegalStateException e) {
           //
           // No field to apply suffix to
           //
           verifyException("org.joda.time.format.PeriodFormatterBuilder", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendPrefixTaking2Arguments() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        periodFormatterBuilder.appendPrefix("';xECuMh");
        PeriodFormatterBuilder appendPrefix = periodFormatterBuilder.appendPrefix("';xECuMh", "';xECuMh");
        assertSame(appendPrefix, periodFormatterBuilder);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendPrefixTaking2ArgumentsThrowsIllegalArgumentException() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        // Undeclared exception!
        try { 
          periodFormatterBuilder.appendPrefix("q|Kd", (String) null);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.joda.time.format.PeriodFormatterBuilder", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendPrefixTaking2ArgumentsWithNull() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        // Undeclared exception!
        try { 
          periodFormatterBuilder.appendPrefix((String) null, (String) null);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.joda.time.format.PeriodFormatterBuilder", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendPrefixTakingStringThrowsIllegalArgumentException() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        // Undeclared exception!
        try { 
          periodFormatterBuilder.appendPrefix((String) null);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.joda.time.format.PeriodFormatterBuilder", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendLiteralThrowsIllegalStateException() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        PeriodFormatterBuilder appendPrefix = periodFormatterBuilder.appendPrefix("'f");
        // Undeclared exception!
        try { 
          appendPrefix.appendLiteral("'f");
          fail("Expecting exception: IllegalStateException");
        
        } catch(IllegalStateException e) {
           //
           // Prefix not followed by field
           //
           verifyException("org.joda.time.format.PeriodFormatterBuilder", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendLiteralThrowsIllegalArgumentException() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        // Undeclared exception!
        try { 
          periodFormatterBuilder.appendLiteral((String) null);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // Literal must not be null
           //
           verifyException("org.joda.time.format.PeriodFormatterBuilder", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendTaking2ArgumentsThrowsIllegalArgumentException() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        // Undeclared exception!
        try { 
          periodFormatterBuilder.append((PeriodPrinter) null, (PeriodParser) null);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // No printer or parser supplied
           //
           verifyException("org.joda.time.format.PeriodFormatterBuilder", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendTakingPeriodFormatterThrowsIllegalArgumentException() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        // Undeclared exception!
        try { 
          periodFormatterBuilder.append((PeriodFormatter) null);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // No formatter supplied
           //
           verifyException("org.joda.time.format.PeriodFormatterBuilder", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testClear() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        periodFormatterBuilder.clear();
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testToParserReturningNull() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        PeriodFormatterBuilder.Literal arg0 = PeriodFormatterBuilder.Literal.EMPTY;
        PeriodFormatterBuilder append = periodFormatterBuilder.append((PeriodPrinter) arg0, (PeriodParser) null);
        PeriodParser parser = append.toParser();
        assertNull(parser);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testToPrinterReturningNull() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        PeriodFormatterBuilder.Literal arg1 = PeriodFormatterBuilder.Literal.EMPTY;
        PeriodFormatterBuilder append = periodFormatterBuilder.append((PeriodPrinter) null, (PeriodParser) arg1);
        PeriodPrinter printer = append.toPrinter();
        assertNull(printer);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendSeparatorIfFieldsAfterWithEmptyString() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        periodFormatterBuilder.appendSeparatorIfFieldsAfter("");
        PeriodPrinter printer = periodFormatterBuilder.toPrinter();
        LocalTime arg1 = new LocalTime((-1121L));
        PeriodType arg2 = PeriodType.minutes();
        Period arg0 = new Period(arg1, arg1, arg2);
        int calculatePrintedLength = printer.calculatePrintedLength(arg0, (Locale) null);
        assertEquals(0, calculatePrintedLength);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendLiteral() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        PeriodFormatterBuilder appendLiteral = periodFormatterBuilder.appendLiteral("|EkG:#IaX");
        assertSame(periodFormatterBuilder, appendLiteral);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void test4() throws Throwable  {
        Period arg0 = new Period(0, 292279001, 292279001, 1189, 3118, 3118, 292279001, 85);
        // Undeclared exception!
        try { 
          Days.standardDaysIn(arg0);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // Cannot convert period to duration as months is not precise in the period P292279001M292279001W1189DT3118H3118M292279001.085S
           //
           verifyException("org.joda.time.base.BaseSingleFieldPeriod", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendMillis3Digit() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        PeriodFormatterBuilder appendMillis3Digit = periodFormatterBuilder.appendMillis3Digit();
        assertSame(appendMillis3Digit, periodFormatterBuilder);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesPeriodFormatterBuilderTakingNoArgumentsAndCallsAppendSeparatorTaking3Arguments() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        String[] arg2 = new String[0];
        PeriodFormatterBuilder appendSeparator = periodFormatterBuilder.appendSeparator("#ZlF", "#ZlF", arg2);
        assertSame(appendSeparator, periodFormatterBuilder);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCalculatePrintedLengthTaking2ArgumentsAndToPrinter() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        periodFormatterBuilder.appendSecondsWithOptionalMillis();
        PeriodPrinter printer = periodFormatterBuilder.toPrinter();
        Months arg0 = Months.NINE;
        Locale arg1 = Locale.KOREAN;
        int calculatePrintedLength = printer.calculatePrintedLength(arg0, arg1);
        assertEquals(0, calculatePrintedLength);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendSeparatorTakingString() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        PeriodFormatterBuilder appendSeparator = periodFormatterBuilder.appendSeparator("Pac[ific/APx}pia");
        assertSame(periodFormatterBuilder, appendSeparator);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMinimumPrintedDigits() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        PeriodFormatterBuilder minimumPrintedDigits = periodFormatterBuilder.minimumPrintedDigits(1893);
        assertSame(minimumPrintedDigits, periodFormatterBuilder);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendSeparatorIfFieldsAfterThrowsIllegalArgumentException() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        // Undeclared exception!
        try { 
          periodFormatterBuilder.appendSeparatorIfFieldsAfter((String) null);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.joda.time.format.PeriodFormatterBuilder", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendSeparatorIfFieldsBefore() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        PeriodFormatterBuilder appendSeparatorIfFieldsBefore = periodFormatterBuilder.appendSeparatorIfFieldsBefore("org.joda.time.LocalDateTime");
        assertSame(appendSeparatorIfFieldsBefore, periodFormatterBuilder);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrintZeroNever() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        periodFormatterBuilder.printZeroNever();
        PeriodFormatterBuilder appendSecondsWithOptionalMillis = periodFormatterBuilder.appendSecondsWithOptionalMillis();
        PeriodPrinter printer = appendSecondsWithOptionalMillis.toPrinter();
        StringBuffer arg0 = new StringBuffer();
        Period arg1 = new Period();
        Locale arg2 = Locale.US;
        printer.printTo(arg0, (ReadablePeriod) arg1, arg2);
        assertEquals("", arg0.toString());
        assertEquals(0, arg0.length());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMaximumParsedDigits() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        PeriodFormatterBuilder maximumParsedDigits = periodFormatterBuilder.maximumParsedDigits(2560);
        assertSame(periodFormatterBuilder, maximumParsedDigits);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrintToTaking11And1AndPrintZeroRarelyFirst1() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        PeriodFormatterBuilder printZeroRarelyFirst = periodFormatterBuilder.printZeroRarelyFirst();
        PeriodFormatterBuilder appendSecondsWithOptionalMillis = printZeroRarelyFirst.appendSecondsWithOptionalMillis();
        PeriodPrinter printer = appendSecondsWithOptionalMillis.toPrinter();
        assertNotNull(printer);
        
        StringBuffer arg0 = new StringBuffer();
        Period arg1 = Period.years(2568);
        Locale arg2 = Locale.CANADA_FRENCH;
        printer.printTo(arg0, (ReadablePeriod) arg1, arg2);
        assertEquals("", arg0.toString());
        assertEquals(0, arg0.length());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendYears() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        PeriodFormatterBuilder appendYears = periodFormatterBuilder.appendYears();
        assertSame(periodFormatterBuilder, appendYears);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendSuffixTaking2Arguments() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        periodFormatterBuilder.appendSecondsWithMillis();
        PeriodFormatterBuilder appendSuffix = periodFormatterBuilder.appendSuffix("", "Offset is too large");
        assertSame(appendSuffix, periodFormatterBuilder);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrintZeroIfSupported() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        PeriodFormatterBuilder printZeroIfSupported = periodFormatterBuilder.printZeroIfSupported();
        periodFormatterBuilder.appendSecondsWithMillis();
        PeriodPrinter printer = printZeroIfSupported.toPrinter();
        StringBuffer arg0 = new StringBuffer();
        Period arg1 = Period.ZERO;
        Locale arg2 = Locale.US;
        printer.printTo(arg0, (ReadablePeriod) arg1, arg2);
        assertEquals(5, arg0.length());
        assertEquals("0.000", arg0.toString());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAppendSuffixTaking2ArgumentsThrowsIllegalStateException() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        periodFormatterBuilder.appendSeconds();
        PeriodPrinter arg0 = periodFormatterBuilder.toPrinter();
        PeriodFormatterBuilder.Literal arg1 = PeriodFormatterBuilder.Literal.EMPTY;
        periodFormatterBuilder.append(arg0, (PeriodParser) arg1);
        // Undeclared exception!
        try { 
          periodFormatterBuilder.appendSuffix("czw-s!$JZeLOSsHP/", "(57P<f4$5pA\"7");
          fail("Expecting exception: IllegalStateException");
        
        } catch(IllegalStateException e) {
           //
           // No field to apply suffix to
           //
           verifyException("org.joda.time.format.PeriodFormatterBuilder", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testRejectSignedValues() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        PeriodFormatterBuilder rejectSignedValues = periodFormatterBuilder.rejectSignedValues(true);
        assertSame(rejectSignedValues, periodFormatterBuilder);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrintZeroRarelyLast() throws Throwable  {
        PeriodFormatterBuilder periodFormatterBuilder = new PeriodFormatterBuilder();
        PeriodFormatterBuilder printZeroRarelyLast = periodFormatterBuilder.printZeroRarelyLast();
        assertSame(printZeroRarelyLast, periodFormatterBuilder);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesCompositeAffixTaking2ArgumentsAndCallsPrintToTaking1And1() throws Throwable  {
        PeriodFormatterBuilder.SimpleAffix arg1 = new PeriodFormatterBuilder.SimpleAffix((String) null);
        PeriodFormatterBuilder.CompositeAffix periodFormatterBuilder_CompositeAffix = new PeriodFormatterBuilder.CompositeAffix(arg1, arg1);
        // Undeclared exception!
        try { 
          periodFormatterBuilder_CompositeAffix.printTo((Writer) null, 3);
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.joda.time.format.PeriodFormatterBuilder$SimpleAffix", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrintToTaking1And1AndPrintToTaking1And1AndCreatesCompositeAffixTaking2Arguments() throws Throwable  {
        PeriodFormatterBuilder.PluralAffix arg1 = new PeriodFormatterBuilder.PluralAffix("", "");
        PeriodFormatterBuilder.CompositeAffix periodFormatterBuilder_CompositeAffix = new PeriodFormatterBuilder.CompositeAffix(arg1, arg1);
        StringBuffer arg0 = new StringBuffer("");
        periodFormatterBuilder_CompositeAffix.printTo(arg0, 0);
        assertEquals(0, arg0.length());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesCompositeAffixTaking2ArgumentsAndCallsCalculatePrintedLengthTakingInt() throws Throwable  {
        PeriodFormatterBuilder.PluralAffix arg1 = new PeriodFormatterBuilder.PluralAffix((String) null, "org.joda.time.format.PeriodFormatterBuilder$SimpleAffix");
        PeriodFormatterBuilder.CompositeAffix periodFormatterBuilder_CompositeAffix = new PeriodFormatterBuilder.CompositeAffix(arg1, arg1);
        int calculatePrintedLength = periodFormatterBuilder_CompositeAffix.calculatePrintedLength(2204);
        assertEquals(110, calculatePrintedLength);
    }
  }
  