private void checkPath(TyrusEndpoint endpoint) throws DeploymentException {
   for (TyrusEndpoint tyrusEndpoint : endpoints) {
     if (Match.isEquivalent(endpoint.getPath(), tyrusEndpoint.getPath())) {
       throw new DeploymentException(
           String.format(
               "Found equivalent paths. Added path: '%s' is equivalent with '%s'.",
               endpoint.getPath(), tyrusEndpoint.getPath()));
     }
   }
 }
  TyrusEndpoint getEndpoint(UpgradeRequest request) {
    if (endpoints.isEmpty()) {
      return null;
    }

    final String requestPath = request.getRequestUri();

    for (Match m : Match.getAllMatches(requestPath, endpoints)) {
      final TyrusEndpoint endpoint = m.getTyrusEndpoit();

      for (String name : m.getParameterNames()) {
        request.getParameterMap().put(name, Arrays.asList(m.getParameterValue(name)));
      }

      if (endpoint.upgrade(request)) {
        return endpoint;
      }
    }

    return null;
  }