@Override
    public ExecuteContext before(ExecuteContext context) {
        Object[] arguments = context.getArguments();
        String serviceName = (String) arguments[0];
        List<Object> instances = (List<Object>) arguments[1];
        RequestData requestData = ThreadLocalUtils.getRequestData();
        List<Object> targetInstances = loadBalancerService.getTargetInstances(serviceName, instances, requestData);
        context.skip(targetInstances);
        return context;
    }
@Test
    public void testGetTargetInstances() {
        ThreadLocalUtils.setRequestData(new RequestData(Collections.emptyMap(), "", ""));
        List<ServiceInstance> list = new ArrayList<>();
        DefaultServiceInstance instance1 = new DefaultServiceInstance("foo1", "foo", "foo", 8080, false);
        list.add(instance1);
        DefaultServiceInstance instance2 = new DefaultServiceInstance("bar2", "foo", "bar", 8081, false);
        list.add(instance2);
        arguments[0] = "foo";
        arguments[1] = list;
        List<?> result = (List<?>) interceptor.before(context).getResult();
        Assert.assertEquals(1, result.size());
        Assert.assertEquals(instance2, result.get(0));
    }