public static boolean matchPathToPattern(String requestPath, String endpointPattern) {
        String[] pathPatternParts = endpointPattern.split("/");
        String[] pathParts = requestPath.split("/");

        boolean isMatch = true;
        for (int i = 0; i < pathPatternParts.length; i++) {
            String patternPart = pathPatternParts[i];
            String urlPart = pathParts[i];

            if (patternPart.startsWith("{") && patternPart.endsWith("}")) {
                continue; // Wildcard found, move to the next part
            }

            if (!patternPart.equals(urlPart)) {
                isMatch = false; // Part does not match, URLs do not match
                break;
            }
        }
        return isMatch;
    }
@Test
    public void testMatchPath() {
        String pattern = "/v1/pets/{petId}";
        String path = "/v1/pets/1";
        Assert.assertTrue(StringUtils.matchPathToPattern(path, pattern));
        pattern = "/v1/pets/{petId}/name";
        path = "/v1/pets/1/name";
        Assert.assertTrue(StringUtils.matchPathToPattern(path, pattern));
        pattern = "/v1/pets/{petId}";
        Assert.assertTrue(StringUtils.matchPathToPattern(path, pattern));

        pattern = "/foo/bar";
        Assert.assertTrue(StringUtils.matchPathToPattern("/foo/bar", pattern));
        Assert.assertFalse(StringUtils.matchPathToPattern("/foo/bar?abc=123", pattern));

        pattern = "/gateway/dev/ph-l4j-files/file?version=1";
        Assert.assertFalse(StringUtils.matchPathToPattern("/dev-ph-l4j-files/file?version=1", pattern));

        pattern = "/gateway/dev/ph-l4j-files/file?version=1";
        Assert.assertTrue(StringUtils.matchPathToPattern("/gateway/dev/ph-l4j-files/file?version=1", pattern));

        pattern = "/gateway/dev/ph-l4j-files/file/05048267?version=1";
        Assert.assertFalse(StringUtils.matchPathToPattern("/gateway/dev/ph-l4j-files/file?version=1", pattern));
    }