imports.add("p2");
final ClassGenerator generator = InvokerGenerator.createStubGenerator(new InvokerContext(invokerContext), getClass().getClassLoader(), null, imports);
generator.setInterfaces(InvokerStub.class);
InvokerStub stub = generator.newInstance();
assertEquals("pkg", stub.getPackageName());
assertEquals("TestRule", stub.getRuleClassName());
assertEquals("testMethod", stub.getMethodName());
assertEquals("TestInvokerGenerated", stub.getGeneratedInvokerClassName());
assertEquals(111, stub.hashCode());
assertTrue(Arrays.equals(new String[] { "globalList" }, stub.getGlobals()));
assertTrue(Arrays.equals(new String[] { "java/util/List" }, stub.getGlobalTypes()));
List<String> importList = Arrays.asList(stub.getPackageImports());
assertTrue(importList.contains("p1"));
assertTrue(importList.contains("p2"));
}