MotechJsonReader { public Object readFromStream(InputStream stream, Type ofType) { try { String jsonText = IOUtils.toString(stream); return from(jsonText, ofType, standardTypeAdapters, false); } catch (IOException e) { throw new JsonIOException(e); } } MotechJsonReader();  MotechJsonReader(FieldNamingStrategy fieldNamingStrategy); Object readFromStream(InputStream stream, Type ofType); Object readFromStreamOnlyExposeAnnotations(InputStream stream, Type ofType); Object readFromFile(String classpathFile, Type ofType); Object readFromString(String text, Type ofType); Object readFromStringOnlyExposeAnnotations(String text, Type ofType); Object readFromString(String text, Type ofType, Map<Type, Object> typeAdapters);  }
@Test public void shouldDeserializeJsonObject() { String json = "{'name':'testName'}"; Type type = new TypeToken<TestRecord>() { }.getType(); final Object jsonObject = reader.readFromStream(new ByteArrayInputStream(json.getBytes()), type); assertTrue(jsonObject instanceof TestRecord); assertEquals("testName", ((TestRecord) jsonObject).name); }