### Question:
AbstractBodyAdapter implements BodyAdapter { protected void requireCompatibleOrNull(@Nullable MediaType mediaType) { if (mediaType != null && !isCompatibleWith(mediaType)) { throw new UnsupportedOperationException("adapter not compatible with: " + mediaType); } } protected  AbstractBodyAdapter(MediaType... compatibleMediaTypes); @Override final boolean isCompatibleWith(MediaType mediaType); static Charset charsetOrDefault(@Nullable MediaType mediaType, Charset defaultCharset); static Charset charsetOrUtf8(@Nullable MediaType mediaType); static BodyPublisher attachMediaType(
      BodyPublisher publisher, @Nullable MediaType mediaType);  }### Answer:
@Test void requireCompatibleOrNull() { var adapter = new BodyAdapterImpl(MediaType.of("text", "plain")); assertThrows(UnsupportedOperationException.class, () -> adapter.requireCompatibleOrNull(MediaType.of("application", "json"))); }