@Test
public void readObject() throws Exception {

    String data = "{ string: 'text', number: 2, boolean: true }";
    JSONObject json = ServletHelpers.readObject(
        new BufferedReader(new InputStreamReader(new ByteArrayInputStream(data.getBytes()))));
    assertThat(json.get("string"), equalTo("text"));
    assertThat(json.get("number"), equalTo(2));
    assertThat(json.get("boolean"), equalTo(true));
}