Set<String> (StubElement<?> stubElement) { StubElement<PsiTypeParameterList> typeParamList = stubElement.findChildStubByType(JavaStubElementTypes.TYPE_PARAMETER_LIST); if (typeParamList == null) return Collections.emptySet(); Set<String> methodTypeParams = null; for (Object tStub : typeParamList.getChildrenStubs()) { if (tStub instanceof PsiTypeParameterStub) { if (methodTypeParams == null) methodTypeParams = new HashSet<>(); methodTypeParams.add(((PsiTypeParameterStub)tStub).getName()); } } return methodTypeParams == null ? Collections.emptySet() : methodTypeParams; }