@Test
public void shouldNotGenerateTryCatchForIllegalAccessException() throws IOException {
EvoSuite evosuite = new EvoSuite();
String targetClass = com.examples.with.different.packagename.listclasses.ClassWithProtectedMethods.class.getCanonicalName();
String[] command = new String[] { "-generateSuite", "-class", targetClass };
Object result = evosuite.parseCommandLine(command);
GeneticAlgorithm<?> ga = getGAFromResult(result);
TestSuiteChromosome best = (TestSuiteChromosome) ga.getBestIndividual();
String name = targetClass.substring(targetClass.lastIndexOf(".") + 1) + Properties.JUNIT_SUFFIX;
String junitFile = Properties.TEST_DIR + File.separatorChar +
Properties.CLASS_PREFIX.replace('.', File.separatorChar) + File.separatorChar +
name + ".java";
Path path = Paths.get(junitFile);
Assert.assertTrue("Test Suite does not exist: "+path, Files.exists(path));
System.out.println(path.toString());
String testCode = new String(Files.readAllBytes(path));
Files.delete(path);
System.out.println(testCode);
assertFalse("IllegalAccessException should not occur", testCode.contains("catch(IllegalAccessException e)"));
}