}
@Test
public void testFindLabelsPossibleFromSuperTypes() {
FusionEnvironment<?> env = new FusionEnvironment<TestAliasContext>(aliases, null, null, testH, new InferenceEnvironment(null), Variant.PRAGMATIC_VARIANT);
FreeVars fv = new FreeVars().addVar(new SpecVar("a"), "SnaFu").addVar(new SpecVar("b"), "Baz");
ConsList<Binding> list = ConsList.empty();
list = ConsList.cons(new Binding(new SpecVar("a"), vars[3]), list);
list = ConsList.cons(new Binding(new SpecVar("b"), vars[4]), list);
List<Substitution> subs = env.findLabels(list, fv);
assertEquals(2, subs.size());
Iterator<Substitution> itr = subs.iterator();
assertTrue(itr.hasNext());
Substitution subA = itr.next();
assertTrue(itr.hasNext());
Substitution subB = itr.next();
assertEquals(2, subA.size());
assertEquals(2, subB.size());
if (subA.getSub(new SpecVar("b")).equals(labels[6])) {
assertEquals(labels[0], subA.getSub(new SpecVar("a")));
assertEquals(labels[5], subB.getSub(new SpecVar("b")));
assertEquals(labels[0], subB.getSub(new SpecVar("a")));
}
else {
assertEquals(labels[5], subA.getSub(new SpecVar("b")));
assertEquals(labels[0], subA.getSub(new SpecVar("a")));
assertEquals(labels[6], subB.getSub(new SpecVar("b")));
assertEquals(labels[0], subB.getSub(new SpecVar("a")));
}
}