code: public Optional<Commit> getOptionalCommit(Object projectIdOrPath, String sha) {
          try {
              return (Optional.ofNullable(getCommit(projectIdOrPath, sha)));
          } catch (GitLabApiException glae) {
              return (GitLabApi.createOptionalFromException(glae));
          }
      }
docs: Get a specific commit identified by the commit hash or name of a branch or tag as an Optional instance
  
  <pre><code>GitLab Endpoint: GET /projects/:id/repository/commits/:sha</code></pre>
  
  @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
  @param sha a commit hash or name of a branch or tag
  @return the Commit for the specified project ID/sha pair as an Optional instance