@Override
    public List<Object> handle(String targetName, List<Object> instances, RequestData requestData) {
        if (requestData == null) {
            return super.handle(targetName, instances, null);
        }
        if (!shouldHandle(instances)) {
            return instances;
        }
        List<Object> result = routerConfig.isUseRequestRouter()
                ? getTargetInstancesByRequest(targetName, instances, requestData.getTag())
                : getTargetInstancesByRules(targetName, instances, requestData.getPath(), requestData.getTag());
        return super.handle(targetName, result, requestData);
    }
@Test
    public void testGetMismatchInstances() {
        RuleInitializationUtils.initFlowMatchRule();
        List<Object> instances = new ArrayList<>();
        ServiceInstance instance1 = TestDefaultServiceInstance.getTestDefaultServiceInstance("1.0.0");
        instances.add(instance1);
        ServiceInstance instance2 = TestDefaultServiceInstance.getTestDefaultServiceInstance("1.0.1");
        instances.add(instance2);

        Map<String, List<String>> header = new HashMap<>();
        header.put("bar", Collections.singletonList("bar2"));
        List<Object> targetInstances = flowRouteHandler.handle("foo", instances, new RequestData(header, null, null));
        Assert.assertEquals(1, targetInstances.size());
        Assert.assertEquals(instance1, targetInstances.get(0));
        ConfigCache.getLabel(RouterConstant.SPRING_CACHE_NAME).resetRouteRule(Collections.emptyMap());
    }