Could I somehow use AssertJ to assert a List has only one instance of a (sub)class?
public class A {}
public class B extends A {}
public class C extends A {}
@Test
public void test() {
List<A> list = new ArrayList<A>();
list.add(new B());
Assertions.assertThat(list).containsOnlyOnce(B.class);
}