StreamConverter implements GenericHttpMessageConverter<Stream<T>> { @Override public void write(final Stream<T> t, final MediaType mediaType, final HttpOutputMessage message) { throw new UnsupportedOperationException(); }  @Override boolean canRead(final Class<?> clazz, final MediaType mediaType); @Override boolean canRead(final Type type, @Nullable final Class<?> contextClass, final MediaType mediaType); @Override List<MediaType> getSupportedMediaTypes(); @Override Stream<T> read(final Class<? extends Stream<T>> clazz, final HttpInputMessage inputMessage); @Override Stream<T> read(final Type type, final Class<?> contextClass, final HttpInputMessage inputMessage); @Override boolean canWrite(final Class<?> clazz, final MediaType mediaType); boolean canWrite(final Type type, final Class<?> clazz, final MediaType mediaType); @Override void write(final Stream<T> t, final MediaType mediaType, final HttpOutputMessage message); void write(final Stream<T> t, final Type type, final MediaType mediaType, final HttpOutputMessage message);  }
@Test void writeNotSupported() { final HttpMessageConverter<Stream<Object>> unit = streamConverter(); assertThrows(UnsupportedOperationException.class, () -> unit.write(null, APPLICATION_X_JSON_STREAM, null)); }
@Test void writeGenericNotSupported() { final StreamConverter<AccountBody> unit = streamConverter(); assertThrows(UnsupportedOperationException.class, () -> unit.write(null, Streams.streamOf(AccountBody.class).getType(), APPLICATION_X_JSON_STREAM, null)); }