BlockingIOAdapter { public static CloseableIterator<ParserToken> parse(final InputStream inputStream, final MultipartContext multipartContext){ return parse(inputStream, multipartContext, null, DEFAULT_BUFFER_SIZE, DEFAULT_HEADERS_SECTION_SIZE, DEFAULT_MAX_LEVEL_OF_NESTED_MULTIPART); }  static CloseableIterator<ParserToken> parse(final InputStream inputStream, final MultipartContext multipartContext); static CloseableIterator<ParserToken> parse(final InputStream inputStream, final MultipartContext multipartContext, final PartBodyStreamStorageFactory partBodyStreamStorageFactory); static CloseableIterator<ParserToken> parse(final InputStream inputStream, final MultipartContext multipartContext, final int bufferSize); @SuppressWarnings("unchecked") static CloseableIterator<ParserToken> parse(final InputStream inputStream,
                                                       final MultipartContext multipartContext,
                                                       final PartBodyStreamStorageFactory partBodyStreamStorageFactory,
                                                       final int bufferSize,
                                                       final int maxHeadersSectionSize,
                                                       final int maxLevelOfNestedMultipart);  }
@Test public void testCreation() throws Exception { final PartBodyStreamStorageFactory partBodyStreamStorageFactory = mock(PartBodyStreamStorageFactory.class); final InputStream inputStream = mock(InputStream.class); final MultipartContext context = mock(MultipartContext.class); when(context.getContentType()).thenReturn("multipart/form-data;boundary=MUEYT2qJT0_ZzYUvVQLy_DlrLeADyxzmsA"); CloseableIterator<ParserToken> parts = BlockingIOAdapter.parse(inputStream, context); assertNotNull(parts); CloseableIterator<ParserToken> parts1 = BlockingIOAdapter.parse(inputStream, context, 500); assertNotNull(parts1); CloseableIterator<ParserToken> parts2 = BlockingIOAdapter.parse(inputStream, context, partBodyStreamStorageFactory); assertNotNull(parts2); CloseableIterator<ParserToken> parts3 = BlockingIOAdapter.parse(inputStream, context, partBodyStreamStorageFactory, 500, 200, 2); assertNotNull(parts3); }