HashSet<String> (@NotNull PsiMethod containingMethod) { HashSet<String> variableNames = new HashSet<>(); Arrays.stream(containingMethod.getParameterList().getParameters()) .forEach(parameter -> variableNames.add(parameter.getName())); return variableNames; }