### Question:
JavaScriptGenerator { public GenerationUnit generate(Class<?> javaClass, SingleFileGenerator singleFileGenerator, Optional<DependencyCollector> dependencyCollector, Optional<? extends ClassLoader> classLoader, Optional<OrderSorter> orderSorter, Optional<LibraryDetector> libraryDetector, GenerationRoots generationRoots) { return generate(javaClass, singleFileGenerator, getDependencyCollector(dependencyCollector), getClassLoader(classLoader), getOrderSorter(orderSorter), getLibraryDetector(libraryDetector), generationRoots, new GenerationUnit()); }  GenerationUnit generate(Class<?> javaClass, SingleFileGenerator singleFileGenerator,
            Optional<DependencyCollector> dependencyCollector, Optional<? extends ClassLoader> classLoader, 
            Optional<OrderSorter> orderSorter, Optional<LibraryDetector> libraryDetector, 
            GenerationRoots generationRoots); GenerationUnit generate(Class<?> javaClass, SingleFileGenerator singleFileGenerator,
            Optional<DependencyCollector> dependencyCollector, Optional<? extends ClassLoader> classLoader, 
            Optional<OrderSorter> orderSorter, Optional<LibraryDetector> libraryDetector, 
            GenerationRoots generationRoots, GenerationUnit unit); GenerationUnit generateAll(Class<?> javaClass, SingleFileGenerator singleFileGenerator,
            Optional<DependencyCollector> dependencyCollector, Optional<? extends ClassLoader> classLoader, 
            Optional<OrderSorter> orderSorter, Optional<LibraryDetector> libraryDetector, GenerationRoots generationRoots); GenerationUnit generateAll(List<Class<?>> javaClasses, SingleFileGenerator singleFileGenerator,
            Optional<DependencyCollector> dependencyCollector, Optional<? extends ClassLoader> classLoader, 
            Optional<OrderSorter> orderSorter, Optional<LibraryDetector> libraryDetector, GenerationRoots generationRoots);  }### Answer:
@Test public void single() { GenerationUnit unit = generator.generate(TestWebPage.class, singleFileGenerator, Optional.<DependencyCollector>absent(), Optional.of(classLoader), Optional.<OrderSorter>absent(), Optional.<LibraryDetector>absent(), generationRoots); assertTrue(unit.getMissingDependencies().contains(BaseWebPage.class.getName())); assertTrue(unit.visitedClassesContains(TestWebPage.class.getName())); String javaScript = unit.getGenerationResult(TestWebPage.class.getName()).get().getSingleResult().toString(); assertThat(javaScript, containsString( TestWebPage.class.getAnnotation(Namespace.class).value() + "." + TestWebPage.class.getSimpleName())); assertThat(javaScript, containsString("\"" + TestWebPage.MESSAGE + "\"")); }