@Test @DisplayName("accept runtime exceptions") void acceptExceptions() { DeliveryErrors.Builder builder = DeliveryErrors.newBuilder(); RuntimeException mockException = new IllegalArgumentException("42"); builder.addException(mockException); DeliveryErrors errors = builder.build(); IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, errors::throwIfAny); assertThat(exception) .isEqualTo(mockException); }
public static Builder newBuilder() { return new Builder(); }
DeliveryErrors { public static Builder newBuilder() { return new Builder(); } }
DeliveryErrors { public static Builder newBuilder() { return new Builder(); } private  DeliveryErrors(Builder builder); }
DeliveryErrors { public static Builder newBuilder() { return new Builder(); } private  DeliveryErrors(Builder builder); static Builder newBuilder(); }
DeliveryErrors { public static Builder newBuilder() { return new Builder(); } private  DeliveryErrors(Builder builder); static Builder newBuilder();  }