class ComparableDependency extends AbstractDependency {

    @Override
    public final CheckResult call() throws Exception {
        // TODO Replace this with a SimpleDependency and a CheckMethod that accepts a WallClock.
        final long start = System.currentTimeMillis();
        try {
            final T value = getValue();
            final CheckStatus status;
            final T threshold;
            if (value.compareTo(maxOK) <= 0) {
                threshold = null;
                status = CheckStatus.OK;
            } else if (maxMinor != null && value.compareTo(maxMinor) <= 0) {
                threshold = maxOK;
                status = CheckStatus.MINOR;
            } else if (maxMajor != null && value.compareTo(maxMajor) <= 0) {
                threshold = maxMinor;
                status = CheckStatus.MAJOR;
            } else {
                threshold = maxMajor != null ? maxMajor : (maxMinor != null ? maxMinor : maxOK);
                status = CheckStatus.OUTAGE;
            }
            final long duration = System.currentTimeMillis() - start;
            final String errorMessage = formatErrorMessage(status, value, threshold, start, duration, null);
            return CheckResult.newBuilder(this, status, errorMessage)
                    .setTimestamp(start)
                    .setDuration(duration)
                    .build();

        } catch (final Exception e) {
            final long duration = System.currentTimeMillis() - start;
            final String errorMessage = formatErrorMessage(CheckStatus.OUTAGE, null, null, start, duration, e);
            return CheckResult.newBuilder(this, CheckStatus.OUTAGE, errorMessage)
                    .setTimestamp(start)
                    .setDuration(duration)
                    .setThrowable(e)
                    .build();
        }
    }

    @Deprecated public  ComparableDependency(
            @Nonnull final String id,
            @Nonnull final String description,
            final long timeout,
            final long pingPeriod,
            @Nonnull final Urgency urgency,
            @Nonnull final T maxOK,
            @Nullable final T maxMinor,
            @Nullable final T maxMajor
    );
    public  ComparableDependency(
            @Nonnull final String id,
            @Nonnull final String description,
            final long timeout,
            final long pingPeriod,
            @Nonnull final Urgency urgency,
            @Nonnull final DependencyType type,
            @Nonnull final String servicePool,
            @Nonnull final T maxOK,
            @Nullable final T maxMinor,
            @Nullable final T maxMajor
    );

}