code: private String removeTrailingSlash(String originalPath) {
          String trailingSlash = "/";
          String requestPath = originalPath;
          if (requestPath != null && !requestPath.isEmpty() && !requestPath.equals(trailingSlash)) {
              requestPath = requestPath.endsWith(trailingSlash) ? requestPath.substring(0, requestPath.length() - 1) : requestPath;
          }
          return requestPath;
      }
docs: <p>
  Handler that removes trailing slash from incoming requests in order to avoid null path parameters
  For example:
  For a given resource <b>/users/{id}</b>
  <b>/users/</b> would match with the resource, passing in an null id
  Instead it would rewrite to
  <b>/users</b> causing a 404, thus avoiding null path parameter