BinaryValidationResult { @Nullable public Throwable getReasonForInvalidity() { return 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 getReasonForInvalidity() { final IllegalStateException expectedReasonForInvalidity = new IllegalStateException("foo"); final BinaryValidationResult underTest = BinaryValidationResult.invalid(expectedReasonForInvalidity); assertThat(underTest.getReasonForInvalidity()).isEqualTo(expectedReasonForInvalidity); }