Response { public Stream<Object> decodeJsonArray() { @SuppressWarnings("unchecked") final Collection<Object> results = (Collection<Object>) Json.fromJson(text); return results.stream(); } Response(int status, String text, Map<String, List<String>> headers); int getStatus(); String getText(); Map<String, List<String>> getHeaders(); boolean success(); Optional<Object> decodeJson(); Stream<Object> decodeJsonArray();  }
@Test void decodeJsonArray() { final Response array = new Response(200, "[]", new HashMap<>()); assertNotNull(array.decodeJsonArray()); }