@Test public void equality() { new EqualsTester() .addEqualityGroup(UTypeVarIdent.create("E")) .addEqualityGroup(UTypeVarIdent.create("T")) .testEquals(); }
@Test public void inline() { ImportPolicy.bind(context, ImportPolicy.IMPORT_TOP_LEVEL); Symtab symtab = Symtab.instance(context); Type listType = symtab.listType; bind( new UTypeVar.Key("E"), TypeWithExpression.create( new ClassType(listType, List.<Type>of(symtab.stringType), listType.tsym))); assertInlines("List<String>", UTypeVarIdent.create("E")); assertEquals(ImmutableSet.of("java.util.List"), inliner.getImportsToAdd()); }
@Test public void serialization() { SerializableTester.reserializeAndAssert(UTypeVarIdent.create("E")); }