@Override
    public Map<String, String> apply(Object obj) {
        Object instanceInfo = ReflectUtils.invokeWithNoneParameter(obj, "getInstance");
        return SpringRouterUtils.getMetadata(ReflectUtils.invokeWithNoneParameter(instanceInfo, "getPayload"));
    }
@Test
    public void testApply() throws Exception {
        Map<String, String> map = Collections.singletonMap("foo", "bar");
        ZookeeperInstance instance = new ZookeeperInstance("id", "name", map);
        ServiceInstanceBuilder<ZookeeperInstance> builder = ServiceInstance.builder();
        ServiceInstance<ZookeeperInstance> serviceInstance =
                builder.address("localhost").port(80).name("name").payload(instance).build();
        ZookeeperServer server = new ZookeeperServer(serviceInstance);
        ZookeeperMetadataMapper mapper = new ZookeeperMetadataMapper();
        Map<String, String> metadata = mapper.apply(server);
        Assert.assertNotNull(metadata);
        Assert.assertEquals("bar", metadata.get("foo"));
    }