public static void saveContractInfo(Contract contract) {
        if (!CONTRACT_MAP.containsKey(contract.getServiceKey())) {
            CONTRACT_MAP.putIfAbsent(contract.getServiceKey(), contract);
        } else if (Objects.equals(contract.getServiceType(), ServiceType.DUBBO.getType())) {
            Contract oldContract = CONTRACT_MAP.get(contract.getServiceKey());
            oldContract.setMethodInfoList(contract.getMethodInfoList());
        } else {
            Contract oldContract = CONTRACT_MAP.get(contract.getServiceKey());
            oldContract.getMethodInfoList().addAll(contract.getMethodInfoList());
        }
    }
@Test
    public void saveContractInfo() {
        Contract contract = new Contract();
        contract.setServiceKey(CollectorCacheTest.class.getName());
        contract.setServiceType(ServiceType.DUBBO.getType());
        contract.setInterfaceName(CollectorCacheTest.class.getName());
        List<MethodInfo> methodInfoList = new ArrayList<>();
        for (Method method : CollectorCacheTest.class.getMethods()) {
            MethodInfo methodInfo = new MethodInfo();
            methodInfo.setName(method.getName());
            methodInfoList.add(methodInfo);
        }
        CollectorCache.saveContractInfo(contract);
        Assert.assertFalse(CollectorCache.CONTRACT_MAP.isEmpty());
        CollectorCache.saveContractInfo(contract);
        Assert.assertTrue(CollectorCache.CONTRACT_MAP.size() == 1);
        Assert.assertTrue(CollectorCache.CONTRACT_MAP.containsKey(CollectorCacheTest.class.getName()));
    }