@Test
  void getText() throws IOException {
    BsonParser p = Parsers.createParser("{ \"a\" : true, \"b\": \"foo\" }");
    assertNull(p.currentToken());
    assertNull(p.getCurrentName());
    assertNull(p.getText());
    assertToken(JsonToken.START_OBJECT, p.nextToken());
    assertToken(JsonToken.START_OBJECT, p.currentToken());
    assertToken(JsonToken.START_OBJECT, p.currentToken()); // read same token multiple times
    assertToken(JsonToken.FIELD_NAME, p.nextToken());
    assertToken(JsonToken.FIELD_NAME, p.currentToken());
    assertToken(JsonToken.FIELD_NAME, p.currentToken()); // read same token multiple times
    assertEquals("a", p.getCurrentName());
    assertEquals("a", p.getCurrentName()); // read current name multiple times
    assertEquals("a", p.getText()); // read same text multiple times
    assertEquals("a", p.getText());

    assertToken(JsonToken.VALUE_TRUE, p.nextToken());
    assertToken(JsonToken.VALUE_TRUE, p.currentToken()); // read same token multiple times
    assertToken(JsonToken.VALUE_TRUE, p.currentToken());
    assertEquals(JsonToken.VALUE_TRUE.asString(), p.getText());
    assertEquals(JsonToken.VALUE_TRUE.asString(), p.getText()); // as text multiple times

    assertToken(JsonToken.FIELD_NAME, p.nextToken());
    assertEquals("b", p.getCurrentName());
    assertEquals("b", p.getCurrentName());
    assertToken(JsonToken.VALUE_STRING, p.nextToken());
    assertEquals("foo", p.getText());
    assertEquals("foo", p.getText()); // read same text multiple times
    assertEquals("foo", p.getText());
    assertToken(JsonToken.END_OBJECT, p.nextToken());
    assertNull(p.nextToken());
    assertNull(p.nextToken());
    p.close();
    assertTrue(p.isClosed());
  }
Just traverse the stream without reading any values
criteria/mongo/test/org/immutables/criteria/mongo/bson4jackson/BsonParserTreeTest.java