@Test @DisplayName("accept model errors") void acceptErrors() { DeliveryErrors.Builder builder = DeliveryErrors.newBuilder(); ModelError mockError = new ModelError("boo!"); builder.addError(mockError); DeliveryErrors errors = builder.build(); ModelError error = assertThrows(ModelError.class, errors::throwIfAny); assertThat(error) .isEqualTo(mockError); }
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();  }