List<TypeAnnotationWriteHelper> ( int argIndex, List<TypeAnnotationWriteHelper> typeAnnWriteHelpers ) { return typeAnnWriteHelpers.stream().filter(typeAnnWriteHelper -> { StructTypePathEntry entry = typeAnnWriteHelper.getPaths().peek(); boolean inGeneric = entry != null && entry.getTypeArgumentIndex() == argIndex && entry.getTypePathEntryKind() == StructTypePathEntry.Kind.TYPE.getId(); if (inGeneric) typeAnnWriteHelper.getPaths().pop(); return inGeneric; }).collect(Collectors.toList()); }