@Test
public void shouldParseJsonArray() throws Exception {

    // Given
    final BiFunction<HttpRequestBase, HttpResponse, Set<String>> extractStatuses =
            toJson(new ObjectMapper()).andThen(jsonNode -> {
                final Iterator<JsonNode> elements = jsonNode.elements();
                Set<String> statuses = new HashSet<>();
                while (elements.hasNext()) {
                    final JsonNode element = elements.next();
                    statuses.add(element.get("status").asText());
                }
                return statuses;
            });
    final BasicHttpResponse response = buildResponse();
    response.setEntity(new StringEntity("[{\"status\":\"OK\"}, {\"status\":\"OK\"}, {\"status\":\"CANCEL\"}]"));
    final HttpGet request = buildRequest();
    // When
    final Set<String> statuses = extractStatuses.apply(request, response);
    // Then
    assertEquals(2, statuses.size());
    assertTrue(statuses.contains("OK"));
    assertTrue(statuses.contains("CANCEL"));
}