public static boolean isFactoryMethod(PsiMethod method) {
    if (!method.hasModifierProperty(PsiModifier.STATIC)) {
      return false;
    }
    final PsiClass aClass = PsiUtil.resolveClassInClassTypeOnly(method.getReturnType());
    return aClass != null && aClass.equals(method.getContainingClass());
  }
public static boolean isFactoryMethod(PsiMethod method)