private static boolean isBeforeVoidReturn(PsiElement element, PsiMethod method) {
    PsiReturnStatement returnStatement =
      ObjectUtils.tryCast(PsiTreeUtil.skipWhitespacesAndCommentsForward(element), PsiReturnStatement.class);
    return isVoidReturn(returnStatement) && PsiTypes.voidType().equals(method.getReturnType());
  }
private static boolean isBeforeVoidReturn(PsiElement element, PsiMethod method)