void () { doTest(""" import java.util.*; class Test { static <A extends CharSequence> A[] toArray(List<CharSequence> cs) { //noinspection unchecked return (A[]) cs.stream().filter(Objects::nonNull).toArray(CharSequence[]::new); } }"""); }