class CentralCollector implements Collector {

    @VisibleForTesting
    static boolean isAgentVersionGreaterThanCentralVersion(String agentVersion,
            String centralVersion) {
        Pattern pattern = Pattern.compile("(\\d+)\\.(\\d+)\\.(\\d+)\\b.*");
        Matcher matcher = pattern.matcher(agentVersion);
        if (!matcher.matches()) {
            if (!agentVersion.equals(Version.UNKNOWN_VERSION)) {
                // conditional is to suppress warning when running tests
                startupLogger.warn("could not parse agent version: {}", agentVersion);
            }
            return false;
        }
        int agentMajor = Integer.parseInt(checkNotNull(matcher.group(1)));
        int agentMinor = Integer.parseInt(checkNotNull(matcher.group(2)));
        int agentPatch = Integer.parseInt(checkNotNull(matcher.group(3)));

        matcher = pattern.matcher(centralVersion);
        if (!matcher.matches()) {
            if (!centralVersion.equals("")) {
                // conditional is to suppress warning when running tests
                startupLogger.warn("could not parse central version: {}", centralVersion);
            }
            return false;
        }
        int centralMajor = Integer.parseInt(checkNotNull(matcher.group(1)));
        int centralMinor = Integer.parseInt(checkNotNull(matcher.group(2)));
        int centralPatch = Integer.parseInt(checkNotNull(matcher.group(3)));

        if (agentMajor > centralMajor) {
            return true;
        }
        if (agentMajor < centralMajor) {
            return false;
        }
        if (agentMinor > centralMinor) {
            return true;
        }
        if (agentMinor < centralMinor) {
            return false;
        }
        return agentPatch > centralPatch;
    }

    public  CentralCollector(Map<String, String> properties, String collectorAddress,
            @Nullable String collectorAuthority, List<File> confDirs, boolean configReadOnly,
            LiveJvmServiceImpl liveJvmService, LiveWeavingServiceImpl liveWeavingService,
            LiveTraceRepositoryImpl liveTraceRepository, AgentConfigUpdater agentConfigUpdater,
            ConfigService configService);

}