public static boolean isVoidMethod(@NotNull PsiMethod method) {
    if (PsiTypes.voidType().equals(method.getReturnType())) {
      return true;
    }

    if (method instanceof GrMethod && ((GrMethod)method).getReturnTypeElementGroovy() == null) {
      GrOpenBlock block = ((GrMethod)method).getBlock();
      if (block != null && isBlockReturnVoid(block)) {
        return true;
      }
    }

    return false;
  }
public static boolean isVoidMethod(@NotNull PsiMethod method)