boolean (@NotNull PsiMethod psiMethod, @Nullable PsiType valueType) { final PsiType expectedType = psiMethod.getReturnType(); if (expectedType == null || valueType == null || expectedType.isAssignableFrom(valueType)) { return true; } if (expectedType instanceof PsiArrayType) { final PsiType componentType = ((PsiArrayType)expectedType).getComponentType(); return componentType.isAssignableFrom(valueType); } return false; }