@Test
public void readsListOfInputItems() throws Exception {

    Class type = List.class;
    ParameterizedType genericType = newParameterizedType(List.class, InputItem.class);
    Annotation[] annotations = new Annotation[0];
    MediaType mediaType = MULTIPART_FORM_DATA_TYPE;
    MultivaluedMap<String, String> headers = new MultivaluedHashMap<>();
    InputStream in = mock(InputStream.class);
    FileItem fileItem = createFileItem("fileItem1");
    MessageBodyReader fileItemReader = createFileItemMessageBodyReader(annotations, mediaType, headers, in, fileItem);
    when(providers.getMessageBodyReader(eq(Iterator.class), eq(newParameterizedType(Iterator.class, FileItem.class)), aryEq(annotations), eq(mediaType)))
            .thenReturn(fileItemReader);
    List<InputItem> inputItems = listMultipartFormDataMessageBodyReader.readFrom(type, genericType, annotations, mediaType, headers, in);
    assertEquals(1, inputItems.size());
    assertEquals(fileItem.getFieldName(), inputItems.get(0).getName());
}