@Test public void highestExceededThresholdShouldReturnHighestThresholdWhenAboveAllThresholds() { assertThat( new QuotaThresholds(ImmutableList.of(_50, _80, _95, _99)) .highestExceededThreshold(Sizes._992_PERTHOUSAND)) .isEqualTo(_99); }
public QuotaThreshold highestExceededThreshold(Quota<?, ?> quota) { return quotaThresholds.stream() .filter(quotaLevel -> quotaLevel.isExceeded(quota)) .findFirst() .orElse(QuotaThreshold.ZERO); }
QuotaThresholds { public QuotaThreshold highestExceededThreshold(Quota<?, ?> quota) { return quotaThresholds.stream() .filter(quotaLevel -> quotaLevel.isExceeded(quota)) .findFirst() .orElse(QuotaThreshold.ZERO); } }
QuotaThresholds { public QuotaThreshold highestExceededThreshold(Quota<?, ?> quota) { return quotaThresholds.stream() .filter(quotaLevel -> quotaLevel.isExceeded(quota)) .findFirst() .orElse(QuotaThreshold.ZERO); } QuotaThresholds(QuotaThreshold... thresholds);  QuotaThresholds(List<QuotaThreshold> quotaThresholds); }
QuotaThresholds { public QuotaThreshold highestExceededThreshold(Quota<?, ?> quota) { return quotaThresholds.stream() .filter(quotaLevel -> quotaLevel.isExceeded(quota)) .findFirst() .orElse(QuotaThreshold.ZERO); } QuotaThresholds(QuotaThreshold... thresholds);  QuotaThresholds(List<QuotaThreshold> quotaThresholds); QuotaThreshold highestExceededThreshold(Quota<?, ?> quota); @Override final boolean equals(Object o); @Override final int hashCode(); @Override String toString(); }
QuotaThresholds { public QuotaThreshold highestExceededThreshold(Quota<?, ?> quota) { return quotaThresholds.stream() .filter(quotaLevel -> quotaLevel.isExceeded(quota)) .findFirst() .orElse(QuotaThreshold.ZERO); } QuotaThresholds(QuotaThreshold... thresholds);  QuotaThresholds(List<QuotaThreshold> quotaThresholds); QuotaThreshold highestExceededThreshold(Quota<?, ?> quota); @Override final boolean equals(Object o); @Override final int hashCode(); @Override String toString();  }