content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Tue Mar 19 18:27:06 GMT 2024
   */
  
  package org.jdom2.transform;
  
  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 java.util.LinkedList;
  import java.util.List;
  import org.evosuite.runtime.EvoRunner;
  import org.evosuite.runtime.EvoRunnerParameters;
  import org.jdom2.Content;
  import org.jdom2.Document;
  import org.jdom2.JDOMFactory;
  import org.jdom2.SlimJDOMFactory;
  import org.jdom2.transform.JDOMResult;
  import org.junit.runner.RunWith;
  import org.xml.sax.ext.DefaultHandler2;
  import org.xml.sax.helpers.XMLFilterImpl;
  
  @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
  public class JDOMResult_ESTest extends JDOMResult_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetFactory() throws Throwable  {
        // Given a JDOMResult object with a SlimJDOMFactory instance
        JDOMResult jDOMResult = new JDOMResult();
        SlimJDOMFactory arg0 = new SlimJDOMFactory();
        
        // When the setFactory method is called with the factory argument
        jDOMResult.setFactory(arg0);
        
        // Then the getFactory method should return the same factory instance
        assertSame(jDOMResult.getFactory(), arg0);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetDocumentReturningNull() throws Throwable  {
        // Given: a JDOMResult object with a null document
        JDOMResult jDOMResult = new JDOMResult();
        Document document = jDOMResult.getDocument();
        
        // When: the getDocument method is called on the JDOMResult object
        
        // Then: the returned document should be null
        assertNull(document);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetDocumentReturningDocumentWhereHasRootElementIsFalse() throws Throwable  {
        // Arrange
        JDOMResult jdomResult = new JDOMResult();
        LinkedList<Content> arg0 = new LinkedList<>();
        
        // Act
        jdomResult.setResult(arg0);
        
        // Assert
        List<Content> result = jdomResult.getResult();
        assertTrue(result.isEmpty());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetResultReturningListWhereSizeIsZero() throws Throwable  {
        // Given: A JDOMResult object is created and initialized with a LinkedList of Content objects.
        JDOMResult jDOMResult = new JDOMResult();
        LinkedList<Content> arg0 = new LinkedList<Content>();
        jDOMResult.setResult(arg0);
        
        // When: The getResult() method is called on the JDOMResult object.
        jDOMResult.getResult();
        
        // Then: The document property of the JDOMResult object should be null.
        assertNull(jDOMResult.getDocument());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetLexicalHandler() throws Throwable  {
        // Given: a JDOMResult object and a DefaultHandler2 object
        JDOMResult jDOMResult = new JDOMResult();
        DefaultHandler2 arg0 = new DefaultHandler2();
        
        // When: the lexical handler is set on the JDOMResult object
        jDOMResult.setLexicalHandler(arg0);
        
        // Then: the JDOMResult object should now have a lexical handler set
        assertNotNull(jDOMResult.getLexicalHandler());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetHandler() throws Throwable  {
        // Given a JDOMResult and an XMLFilterImpl instance
        JDOMResult jDOMResult = new JDOMResult();
        XMLFilterImpl xmlFilter = new XMLFilterImpl();
        
        // When the handler of the JDOMResult is set to the XMLFilterImpl instance
        jDOMResult.setHandler(xmlFilter);
        
        // Then the XMLFilterImpl instance should be the handler of the JDOMResult
        assertEquals(xmlFilter, jDOMResult.getHandler());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetFactoryReturningNull() throws Throwable  {
        // Given: A JDOMResult instance with a null factory
        JDOMResult jDOMResult = new JDOMResult();
        
        // When: The getFactory method is called on the JDOMResult instance
        JDOMFactory factory = jDOMResult.getFactory();
        
        // Then: The factory should be null
        assertNull(factory);
    }
  }
  