IntegralCondition extends BasicCondition<T, IntegralCondition<T>> implements NumberChecks<T, IntegralCondition<T>> { @Override public IntegralCondition<T> isGreaterThanOrEqual(T number) { require(this.subject).isNotNull(); require(number).isNotNull(); if (!(this.subject.longValue() >= number.longValue())) { DbcAssertionError.throwNew(new IllegalArgumentException("Expected integer <" + this.subject + "> to be greater than or equal to <" + number + ">"), this.message); } return result(); } IntegralCondition(T subject); @Override IntegralCondition<T> isGreaterThan(T number); @Override IntegralCondition<T> isGreaterThanOrEqual(T number); @Override IntegralCondition<T> isLessThan(T number); @Override IntegralCondition<T> isLessThanOrEqual(T number);  }
@Test public void isGreaterThanOrEqual() throws Exception { IntegralCondition<Integer> condition = new IntegralCondition<>(2); condition.isGreaterThanOrEqual(2); assertThatThrownBy(() -> condition.isGreaterThanOrEqual(7)) .isInstanceOf(DbcAssertionError.class) .hasCauseInstanceOf(IllegalArgumentException.class); }