@Override
  public boolean hasNext() {
    synchronized (lock) {
      try {
        return parser.peek() != JsonToken.END_DOCUMENT;
      } catch (MalformedJsonException e) {
        throw new JsonSyntaxException(e);
      } catch (IOException e) {
        throw new JsonIOException(e);
      }
    }
  }
@Test
  public void testIncompleteInput() {
    JsonStreamParser parser = new JsonStreamParser("[");
    assertThat(parser.hasNext()).isTrue();
    assertThrows(JsonSyntaxException.class, parser::next);
  }