@Test
public void readsEntityStreamAsIteratorOfFileItems() throws Exception {

    Class type = Iterator.class;
    ParameterizedType genericType = newParameterizedType(Iterator.class, FileItem.class);
    Annotation[] annotations = new Annotation[0];
    MultivaluedMap<String, String> headers = new MultivaluedHashMap<>();
    InputStream in = mock(InputStream.class);
    mockHttpServletRequest();
    Iterator<FileItem> fileItems = formDataEntityProvider.readFrom(type, genericType, annotations, null, headers, in);
    List<FileItem> fileItemList = Lists.newArrayList(fileItems);
    assertEquals(1, fileItemList.size());
    assertEquals("text", fileItemList.get(0).getFieldName());
    assertEquals("test.txt", fileItemList.get(0).getName());
    assertEquals("text/plain", fileItemList.get(0).getContentType());
    assertEquals("hello", fileItemList.get(0).getString());
}