@Test
@UseDataProvider("messageBodyReaderByTypeAndMediaType")
public void retrievesMessageBodyReaderByTypeAndMediaType(boolean singletonOrPerRequest,
                                                         Class<?> readObjectType,
                                                         Type readObjectGenericType,
                                                         MediaType mediaType,
                                                         Object expectedMessageBodyReaderClassOrInstance) throws Exception {

    if (singletonOrPerRequest == SINGLETON) {
        registerSingletonMessageBodyReaders();
    } else {
        registerPerRequestMessageBodyReaders();
    }
    MessageBodyReader messageBodyReader = providers.getMessageBodyReader(readObjectType, readObjectGenericType, null, mediaType);
    if (singletonOrPerRequest == SINGLETON) {
        assertSame(expectedMessageBodyReaderClassOrInstance, messageBodyReader);
    } else {
        if (expectedMessageBodyReaderClassOrInstance == null) {
            assertNull(messageBodyReader);
        } else {
            assertNotNull(messageBodyReader);
            assertEquals(expectedMessageBodyReaderClassOrInstance, messageBodyReader.getClass());
        }
    }
}