public static String extractParamsFromURI(String uri) {
      if (uri.contains("?") && uri.contains("=")) {
         String parameters = uri.substring(uri.indexOf("?") + 1);
         StringBuilder params = new StringBuilder();

         for (String parameter : parameters.split("&")) {
            String[] pair = parameter.split("=");
            String key = URLDecoder.decode(pair[0], StandardCharsets.UTF_8);
            if (params.length() > 0) {
               params.append(" && ");
            }
            params.append(key);
         }
         return params.toString();
      }
      return "";
   }
@Test
   void testExtractParamsFromURI() {
      // Check with parameters.
      String requestPath = "/v2/pet/findByStatus?user_key=998bac0775b1d5f588e0a6ca7c11b852&status=available";

      // Dispatch string params are sorted.
      String dispatchCriteria = DispatchCriteriaHelper.extractParamsFromURI(requestPath);
      assertEquals("user_key && status", dispatchCriteria);
   }