public static Object matchEndpointKey(String path, Map<String, Object> map) {
        if (isEmpty(map)) {
            return null;
        }
        // iterate key set to find the endpoint pattern that matches the request path
        for (String endpoint : map.keySet()) {
            if (StringUtils.matchPathToPattern(path, endpoint)) {
                return map.get(endpoint);
            }
        }
        return null;
    }
@Test
    public void testMatchEndpointKey() {
        Map<String, Object> map = new HashMap<>();
        map.put("/v1/cat/{petId}", "123");
        map.put("/v1/dog/{petId}/uploadImage", "456");
        map.put("/v1/fish/{petId}/uploadImage/{imageId}", "789");

        Assert.assertEquals("123", CollectionUtils.matchEndpointKey("/v1/cat/123", map));
        Assert.assertEquals("456", CollectionUtils.matchEndpointKey("/v1/dog/123/uploadImage", map));
        Assert.assertEquals("789", CollectionUtils.matchEndpointKey("/v1/fish/123/uploadImage/456", map));
    }