// Test case for Issue 1708 // https://github.com/typetools/checker-framework/issues/1708 import java.util.ArrayList; import java.util.Arrays; import java.util.List; @SuppressWarnings("unchecked") public class Issue1708 { static class A {} static class B {} static class C {} static class D {} static class E {} static class F {} static class B1 extends B {} static class B2 extends B {} static class B3 extends B {} public static class Example extends A> { private final List> f; public Example(B1 b1, B2 b2, B3 b3) { f = ListUtil.of(b1, b2, b3); } } public static class ListUtil { public static List of(T... elems) { return new ArrayList<>(Arrays.asList(elems)); } } }