BinaryValidationResult { public static BinaryValidationResult invalid(final Throwable reasonForInvalidity) { return new BinaryValidationResult(checkNotNull(reasonForInvalidity, "reasonForInvalidity")); } private  BinaryValidationResult(@Nullable final Throwable reasonForInvalidity); static BinaryValidationResult valid(); static BinaryValidationResult invalid(final Throwable reasonForInvalidity); boolean isValid(); @Nullable Throwable getReasonForInvalidity(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }
@Test public void invalid() { final BinaryValidationResult underTest = BinaryValidationResult.invalid(new IllegalStateException("foo")); assertThat(underTest.isValid()).isFalse(); }
@Test public void invalidThrowsNPEIfCalledWithNull() { assertThatExceptionOfType(NullPointerException.class) .isThrownBy(() -> BinaryValidationResult.invalid(null)) .withMessage("The reasonForInvalidity must not be null!"); }