List<TypeAnnotationWriteHelper> ( GenericType type, StringBuilder sb, List<TypeAnnotationWriteHelper> typeAnnWriteHelpers ) { if (!type.getArguments().isEmpty()) { sb.append('<'); for (int i = 0; i < type.getArguments().size(); i++) { if (i > 0) { sb.append(", "); } GenericType genPar = type.getArguments().get(i); int wildcard = type.getWildcards().get(i); // only take type paths that are in the generic List<TypeAnnotationWriteHelper> locTypeAnnWriteHelpers = getGenericTypeAnnotations(i, typeAnnWriteHelpers); typeAnnWriteHelpers.removeAll(locTypeAnnWriteHelpers); locTypeAnnWriteHelpers = writeTypeAnnotationBeforeWildCard(sb, genPar, wildcard, locTypeAnnWriteHelpers); switch (wildcard) { case GenericType.WILDCARD_UNBOUND -> sb.append('?'); case GenericType.WILDCARD_EXTENDS -> sb.append("? extends "); case GenericType.WILDCARD_SUPER -> sb.append("? super "); } locTypeAnnWriteHelpers = writeTypeAnnotationAfterWildCard(sb, genPar, locTypeAnnWriteHelpers); if (genPar != null) { sb.append(getGenericCastTypeName(genPar, locTypeAnnWriteHelpers)); } } sb.append(">"); } return typeAnnWriteHelpers; }