class PredictionParameters {

    public static final int DEFAULT_MIN_SAMPLES = 2;
    public static final int DEFAULT_MAX_SAMPLES = 10;

    public final int minSamples;
    public final int maxSamples;
    public final long sampleMaxAgeNanos;

    /**
     * Creates new instance of {@link PredictionParameters}
     *
     * @param minSamples the minimum amount of samples that requred to make prediction about distributed consumption rate.
     * @param maxSamples the maximum amount of samples to store.
     * @param sampleMaxAge the maximum period of time that sample is stored.
     */
    public PredictionParameters(int minSamples, int maxSamples, Duration sampleMaxAge) {
        this(minSamples, maxSamples, sampleMaxAge.toNanos());
    }

    public PredictionParameters(int minSamples, int maxSamples, long maxUnsynchronizedTimeoutNanos) {
        if (minSamples < 2) {
            throw BucketExceptions.wrongValueOfMinSamplesForPredictionParameters(minSamples);
        }
        this.minSamples = minSamples;

        if (maxSamples < minSamples) {
            throw BucketExceptions.maxSamplesForPredictionParametersCanNotBeLessThanMinSamples(minSamples, maxSamples);
        }
        this.maxSamples = maxSamples;

        if (maxUnsynchronizedTimeoutNanos <= 0) {
            throw BucketExceptions.nonPositiveSampleMaxAgeForPredictionParameters(maxUnsynchronizedTimeoutNanos);
        }
        this.sampleMaxAgeNanos = maxUnsynchronizedTimeoutNanos;
    }

    public static PredictionParameters createDefault(DelayParameters delayParameters) {<FILL_FUNCTION_BODY>}

    public int getMinSamples() {
        return minSamples;
    }

    public int getMaxSamples() {
        return maxSamples;
    }

    public long getSampleMaxAgeNanos() {
        return sampleMaxAgeNanos;
    }

}

        long sampleMaxAge = delayParameters.maxUnsynchronizedTimeoutNanos * 2;
        return new PredictionParameters(DEFAULT_MIN_SAMPLES, DEFAULT_MAX_SAMPLES, sampleMaxAge);
    
<no_super_class>