@Test
  public void testStreamingJSON() throws Exception {
    // Test with start row and end row.
    StringBuilder builder = new StringBuilder();
    builder.append("/*");
    builder.append("?");
    builder.append(Constants.SCAN_COLUMN + "=" + COLUMN_1);
    builder.append("&");
    builder.append(Constants.SCAN_START_ROW + "=aaa");
    builder.append("&");
    builder.append(Constants.SCAN_END_ROW + "=aay");
    Response response = client.get("/" + TABLE + builder.toString(), Constants.MIMETYPE_JSON);
    assertEquals(200, response.getCode());

    int count = 0;
    ObjectMapper mapper = new JacksonJaxbJsonProvider().locateMapper(CellSetModel.class,
      MediaType.APPLICATION_JSON_TYPE);
    JsonFactory jfactory = new JsonFactory(mapper);
    JsonParser jParser = jfactory.createJsonParser(response.getStream());
    boolean found = false;
    while (jParser.nextToken() != JsonToken.END_OBJECT) {
      if (jParser.getCurrentToken() == JsonToken.START_OBJECT && found) {
        RowModel row = jParser.readValueAs(RowModel.class);
        assertNotNull(row.getKey());
        for (int i = 0; i < row.getCells().size(); i++) {
          if (count == 0) {
            assertEquals("aaa", Bytes.toString(row.getKey()));
          }
          if (count == 23) {
            assertEquals("aax", Bytes.toString(row.getKey()));
          }
          count++;
        }
        jParser.skipChildren();
      } else {
        found = jParser.getCurrentToken() == JsonToken.START_ARRAY;
      }
    }
    assertEquals(24, count);
  }
An example to scan using listener in unmarshaller for XML.
@throws Exception the exception
hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestTableScan.java