boolean (PsiMethod method) { if (method == null) return false; PsiClass aClass = method.getContainingClass(); if (aClass == null) return false; PsiType primitiveCandidate = null; PsiParameterList list = method.getParameterList(); if (list.isEmpty()) { primitiveCandidate = method.getReturnType(); } else if (list.getParametersCount() == 1) { primitiveCandidate = list.getParameters()[0].getType(); } if (!(primitiveCandidate instanceof PsiPrimitiveType)) return false; return Objects.equals(((PsiPrimitiveType)primitiveCandidate).getBoxedTypeName(), aClass.getQualifiedName()); }