### Question:
MultipartBodyPublisher implements MimeBodyPublisher { public static Builder newBuilder() { return new Builder(); } private  MultipartBodyPublisher(List<Part> parts, MediaType mediaType); String boundary(); List<Part> parts(); @Override MediaType mediaType(); @Override long contentLength(); @Override void subscribe(Subscriber<? super ByteBuffer> subscriber); static Builder newBuilder();  }### Answer:
@Test void addNoParts() { assertThrows(IllegalStateException.class, () -> newBuilder().build()); }
@Test void failingPart() { var body = newBuilder() .formPart("good_part", ofString("such wow")) .formPart("bad_part", fromPublisher(new FailedPublisher<>(TestException::new))) .build(); var ex = assertThrows(CompletionException.class, () -> BodyCollector.collect(body)); var cause = ex.getCause(); assertNotNull(cause); assertEquals(TestException.class, cause.getClass()); }