List<TypeAnnotationWriteHelper> ( StringBuilder sb, GenericType type, List<TypeAnnotationWriteHelper> typeAnnWriteHelpers ) { typeAnnWriteHelpers.forEach(typeAnnWriteHelper -> { // remove all wild card path entries StructTypePathEntry path = typeAnnWriteHelper.getPaths().peek(); boolean isWildCard = path != null && path.getTypePathEntryKind() == StructTypePathEntry.Kind.TYPE_WILDCARD.getId(); if (isWildCard) typeAnnWriteHelper.getPaths().pop(); }); return typeAnnWriteHelpers.stream().filter(typeAnnWriteHelper -> { StructTypePathEntry path = typeAnnWriteHelper.getPaths().peek(); if (type.getArrayDim() == 0 && path == null) { typeAnnWriteHelper.writeTo(sb); return false; } if (type.getArrayDim() == typeAnnWriteHelper.getPaths().size() && type.getArrayDim() == typeAnnWriteHelper.arrayPathCount()) { typeAnnWriteHelper.writeTo(sb); return false; } return true; }).collect(Collectors.toList()); }