@Test
public void readsContentOfEntityStreamAsMapStringToObject() throws Exception {

    String content = "{\"book\": {\"title\": \"JUnit in Action\", \"pages\": 386, \"isdn\": 93011099534534, \"price\": 19.37, \"author\": \"Vincent Massol\"}}";
    Class aClass = Map.class;
    Type genericType = newParameterizedType(aClass, String.class, Book.class);
    Map<String, Book> result = (Map<String, Book>)jsonEntityProvider.readFrom(aClass, genericType, null, APPLICATION_JSON_TYPE, new MultivaluedMapImpl(),
                                                                              new ByteArrayInputStream(content.getBytes()));
    assertEquals(1, result.size());
    assertNotNull(result.get("book"));
    Book book = result.get("book");
    assertEquals("Vincent Massol", book.getAuthor());
    assertEquals("JUnit in Action", book.getTitle());
    assertEquals(386, book.getPages());
    assertEquals(19.37, book.getPrice(), 0.01);
    assertEquals(93011099534534L, book.getIsdn());
}