StreamDataBodyPart extends FormDataBodyPart { @Override public void setValue(final MediaType mediaType, final Object value) throws UnsupportedOperationException { throw new UnsupportedOperationException("It is unsupported, please use setStreamEntity(-) instead!"); } StreamDataBodyPart();  StreamDataBodyPart(final String name, final InputStream streamEntity);  StreamDataBodyPart(final String name, final InputStream streamEntity, final String filename);  StreamDataBodyPart(final String name, final InputStream streamEntity,
                              final String filename,
                              final MediaType mediaType); @Override void setValue(final MediaType mediaType, final Object value); @Override void setValue(final String value); @Override void setEntity(final Object entity); void setStreamEntity(final InputStream streamEntity); void setStreamEntity(final InputStream streamEntity, MediaType mediaType); void setFilename(final String filename); InputStream getStreamEntity(); String getFilename();  }
@Test public void testSetValueString() { try { cut.setValue("foo"); fail(); } catch (UnsupportedOperationException ex) { } }
@Test public void testSetValueMediaTypeObject() { try { cut.setValue(MediaType.APPLICATION_OCTET_STREAM_TYPE, new Object()); fail(); } catch (UnsupportedOperationException ex) { } }