/*
 * This file was automatically generated by EvoSuite
 * Fri Jun 08 20:23:48 GMT 2018
 */

package uk.ac.sanger.artemis.util;

import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.shaded.org.mockito.Mockito.*;
import static org.evosuite.runtime.EvoAssertions.*;
import java.util.NoSuchElementException;
import java.util.Set;
import java.util.function.BiFunction;
import java.util.function.Function;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.ViolatedAssumptionAnswer;
import org.junit.runner.RunWith;
import uk.ac.sanger.artemis.util.CacheHashMap;

@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = false, useJEE = true) 
public class CacheHashMap_ESTest extends CacheHashMap_ESTest_scaffolding {

  @Test(timeout = 4000)
  public void test00()  throws Throwable  {
      CacheHashMap cacheHashMap0 = new CacheHashMap(0, 0);
      Integer integer0 = new Integer(0);
      cacheHashMap0.put(integer0, integer0);
      cacheHashMap0.get("1TWa ");
      Object object0 = cacheHashMap0.get("1TWa ");
      assertNull(object0);
  }

  @Test(timeout = 4000)
  public void test01()  throws Throwable  {
      CacheHashMap cacheHashMap0 = new CacheHashMap(0, 0);
      Integer integer0 = new Integer(0);
      Function<Object, Object> function0 = Function.identity();
      Object object0 = cacheHashMap0.computeIfAbsent(integer0, function0);
      Object object1 = cacheHashMap0.put(object0, integer0);
      assertEquals(0, object1);
  }

  @Test(timeout = 4000)
  public void test02()  throws Throwable  {
      CacheHashMap cacheHashMap0 = new CacheHashMap(0, 0);
      cacheHashMap0.get((Object) null);
      Object object0 = cacheHashMap0.getLastKey();
      assertNull(object0);
  }

  @Test(timeout = 4000)
  public void test03()  throws Throwable  {
      CacheHashMap cacheHashMap0 = new CacheHashMap(0, 0);
      Integer integer0 = new Integer(0);
      cacheHashMap0.put(integer0, integer0);
      Object object0 = cacheHashMap0.getLastKey();
      assertEquals(0, object0);
  }

  @Test(timeout = 4000)
  public void test04()  throws Throwable  {
      CacheHashMap cacheHashMap0 = new CacheHashMap(0, 0);
      Integer integer0 = new Integer(0);
      Function<Object, Object> function0 = Function.identity();
      cacheHashMap0.computeIfAbsent(integer0, function0);
      Object object0 = cacheHashMap0.get(integer0);
      assertEquals(0, object0);
  }

  @Test(timeout = 4000)
  public void test05()  throws Throwable  {
      CacheHashMap cacheHashMap0 = new CacheHashMap(1, 1);
      Set<Object> set0 = cacheHashMap0.keySet();
      Object object0 = new Object();
      cacheHashMap0.put(set0, object0);
      // Undeclared exception!
      try { 
        cacheHashMap0.put("", "");
        fail("Expecting exception: StackOverflowError");
      
      } catch(StackOverflowError e) {
         //
         // no message in exception (getMessage() returned null)
         //
      }
  }

  @Test(timeout = 4000)
  public void test06()  throws Throwable  {
      CacheHashMap cacheHashMap0 = new CacheHashMap(2406, 2406);
      cacheHashMap0.put(cacheHashMap0, "C lMo0ocX");
      // Undeclared exception!
      try { 
        cacheHashMap0.get(cacheHashMap0);
        fail("Expecting exception: StackOverflowError");
      
      } catch(StackOverflowError e) {
         //
         // no message in exception (getMessage() returned null)
         //
      }
  }

  @Test(timeout = 4000)
  public void test07()  throws Throwable  {
      CacheHashMap cacheHashMap0 = null;
      try {
        cacheHashMap0 = new CacheHashMap((-2084), (-2084));
        fail("Expecting exception: IllegalArgumentException");
      
      } catch(IllegalArgumentException e) {
         //
         // Illegal initial capacity: -2084
         //
         verifyException("java.util.HashMap", e);
      }
  }

  @Test(timeout = 4000)
  public void test08()  throws Throwable  {
      CacheHashMap cacheHashMap0 = new CacheHashMap(1, (-1));
      cacheHashMap0.get("");
      Object object0 = cacheHashMap0.put("", cacheHashMap0);
      assertNull(object0);
  }

  @Test(timeout = 4000)
  public void test09()  throws Throwable  {
      CacheHashMap cacheHashMap0 = new CacheHashMap(0, 2082);
      Function<Object, Object> function0 = Function.identity();
      Function<Integer, Object> function1 = function0.compose((Function<? super Integer, ?>) function0);
      cacheHashMap0.get((Object) null);
      Object object0 = cacheHashMap0.put(function1, (Object) null);
      assertNull(object0);
  }

  @Test(timeout = 4000)
  public void test10()  throws Throwable  {
      CacheHashMap cacheHashMap0 = new CacheHashMap(1, (-1));
      Integer integer0 = new Integer((-1));
      BiFunction<Object, Object, Object> biFunction0 = (BiFunction<Object, Object, Object>) mock(BiFunction.class, new ViolatedAssumptionAnswer());
      cacheHashMap0.merge(integer0, "4", biFunction0);
      Object object0 = cacheHashMap0.put((Object) null, (Object) null);
      assertNull(object0);
  }

  @Test(timeout = 4000)
  public void test11()  throws Throwable  {
      CacheHashMap cacheHashMap0 = new CacheHashMap(0, 0);
      // Undeclared exception!
      try { 
        cacheHashMap0.getLastKey();
        fail("Expecting exception: NoSuchElementException");
      
      } catch(NoSuchElementException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("java.util.LinkedList", e);
      }
  }
}
