StringCondition extends BasicCondition<CharSequence, StringCondition> implements StringChecks<StringCondition> { @Override public StringCondition isValid() { require(this.subject).isNotNull(); if (this.subject.toString().trim().length() == 0) { DbcAssertionError.throwNew(new IllegalArgumentException("The provided String is empty"), this.message); } return result(); } StringCondition(CharSequence subject); @Override StringCondition isValid(); @Override StringCondition isValidUUID();  }
@Test public void isValid() throws Exception { StringCondition condition = new StringCondition("Input"); condition.isValid(); StringCondition badCondition = new StringCondition(""); Assertions.assertThatThrownBy(badCondition::isValid) .isInstanceOf(DbcAssertionError.class) .hasCauseInstanceOf(IllegalArgumentException.class); }