### Question:
ClassInstrumentation { public List<Class> instrumentClasses(List<String> interestingClasses, String testingClassName){ List<Class> instrumentedClasses = new ArrayList<>(); List<String> instrumentedClassesName = new ArrayList<>(); List<String> nonDuplicatedClasses = interestingClasses.stream().distinct().collect(Collectors.toList()); try{ for(String clazz : nonDuplicatedClasses){ if (clazz.equals(testingClassName)){ continue; } Properties.TARGET_CLASS=clazz; DependencyAnalysis.addNewTargetClass(clazz); } Properties.TARGET_CLASS=testingClassName; instrumentClassByTestExecution(testingClassName); }catch (Exception e){ LOG.warn("Could not instrument the target class!"); } for(String clazz: nonDuplicatedClasses ){ if(instrumentedClassesName.contains(clazz)){ continue; } LOG.debug("Instrumenting class "+ clazz); Class<?> cls; try { Properties.TARGET_CLASS=clazz; cls = Class.forName(clazz,true, BotsingTestGenerationContext.getInstance().getClassLoaderForSUT()); if(clazz != testingClassName){ instrumentClassByTestExecution(clazz); } instrumentedClasses.add(cls); instrumentedClassesName.add(clazz); } catch (ClassNotFoundException | NoClassDefFoundError e) { LOG.warn("Error in loading {}",clazz); } } return instrumentedClasses; }  List<Class> instrumentClasses(List<String> interestingClasses, String testingClassName); static void instrumentClassByTestExecution(String targetClass);  }### Answer:
@Test public void testOneClass() { interestingClasses.clear(); String className = Integer.class.getName(); interestingClasses.add(className); interestingClasses.add(className); List<Class> instrumentedClasses = instrumentation.instrumentClasses(interestingClasses,className); assert (instrumentedClasses.size() == 1); assertEquals(instrumentedClasses.get(0),Integer.class); }
@Test public void testUnknownClass(){ interestingClasses.clear(); interestingClasses.add("unknown.class.Unknown"); List<Class> instrumentedClasses = instrumentation.instrumentClasses(interestingClasses,"unknown.class.Unknown"); assert (instrumentedClasses.size() == 0); }
@Test public void testMultipleClasses() { interestingClasses.clear(); String className = Integer.class.getName(); interestingClasses.add(className); className = String.class.getName(); interestingClasses.add(className); List<Class> instrumentedClasses = instrumentation.instrumentClasses(interestingClasses,className); assert (instrumentedClasses.size() == 2); assertEquals(instrumentedClasses.get(0),Integer.class); assertEquals(instrumentedClasses.get(1),String.class); }
@Test public void Instrumentable(){ interestingClasses.clear(); interestingClasses.add(Callables.class.getName()); ClassPathHandler.getInstance().changeTargetCPtoTheSameAsEvoSuite(); List<Class> instrumentedClasses = instrumentation.instrumentClasses(interestingClasses,Callables.class.getName()); }