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