InvestmentResult extends Result<InvestmentFailureType> { public static InvestmentResult success() { return SUCCESS; } private  InvestmentResult(); private  InvestmentResult(final ClientErrorException ex); static InvestmentResult success(); static InvestmentResult failure(final ClientErrorException ex);  }
@Test void success() { final InvestmentResult result = InvestmentResult.success(); SoftAssertions.assertSoftly(softly -> { softly.assertThat(result.isSuccess()) .isTrue(); softly.assertThat(result.getFailureType()) .isEmpty(); softly.assertThat(result) .isSameAs(InvestmentResult.success()); }); }