### Question:
IncludeInvokeGenerator implements JavascriptGenerator<RegistryInfo> { @Override public String generate(RegistryInfo generationInformation) { String generatedCode = functionRegistry.generate(generationInformation); functionRegistry.register(generationInformation); return generatedCode; } @Inject  IncludeInvokeGenerator(FunctionRegistry<RegistryInfo> functionRegistry); @Override String generate(RegistryInfo generationInformation);  }### Answer:
@Test public void passesRecordingCodeAndRegistersTheGenerationInformationInRegistry() { final String expected = "something(2, 3);"; FunctionRegistry<RegistryInformation<GenerationFunctionInformation>> functionRegistry = mock(FunctionRegistry.class); RegistryInformation<GenerationFunctionInformation> registryInformation = mock(RegistryInformation.class); when(functionRegistry.generate(registryInformation)).thenReturn(expected); IncludeInvokeGenerator<RegistryInformation<GenerationFunctionInformation>> includeInvokeGenerator = new IncludeInvokeGenerator<>(functionRegistry); String actual = includeInvokeGenerator.generate(registryInformation); assertEquals(expected, actual); verify(functionRegistry).register(registryInformation); }