@Test void checkOverQuotaUponModificationShouldThrowIfLimitExceeded() { assertThatThrownBy(() -> new SieveQuota(CURRENT_USAGE, Optional.of(LIMIT_LOW_VALUE)).checkOverQuotaUponModification(SIZE_DIFFERENCE)) .isInstanceOf(QuotaExceededException.class); }
public void checkOverQuotaUponModification(long sizeDifference) throws QuotaExceededException { if (isExceededUponModification(sizeDifference)) { throw new QuotaExceededException(); } }
SieveQuota { public void checkOverQuotaUponModification(long sizeDifference) throws QuotaExceededException { if (isExceededUponModification(sizeDifference)) { throw new QuotaExceededException(); } } }
SieveQuota { public void checkOverQuotaUponModification(long sizeDifference) throws QuotaExceededException { if (isExceededUponModification(sizeDifference)) { throw new QuotaExceededException(); } } SieveQuota(long currentUsage, Optional<QuotaSizeLimit> limit); }
SieveQuota { public void checkOverQuotaUponModification(long sizeDifference) throws QuotaExceededException { if (isExceededUponModification(sizeDifference)) { throw new QuotaExceededException(); } } SieveQuota(long currentUsage, Optional<QuotaSizeLimit> limit); void checkOverQuotaUponModification(long sizeDifference); boolean isExceededUponModification(long sizeDifference); }
SieveQuota { public void checkOverQuotaUponModification(long sizeDifference) throws QuotaExceededException { if (isExceededUponModification(sizeDifference)) { throw new QuotaExceededException(); } } SieveQuota(long currentUsage, Optional<QuotaSizeLimit> limit); void checkOverQuotaUponModification(long sizeDifference); boolean isExceededUponModification(long sizeDifference);  }