@Test
public void testInternalReadAllTo() {

    final JsonObject parentValue = obj()
            .key("a", "alphaVal")
            .key("bravo", "bravoVal")
            .key("?", "unknownVal")
            .get();
    final Map<String, String> builder = new HashMap<>();
    final WhateverKeyDefToken alphaToken = mock(WhateverKeyDefToken.class);
    when(alphaToken.getLexTokens()).thenReturn(new String[]{"a"});
    final WhateverKeyDefToken bravoToken = mock(WhateverKeyDefToken.class);
    when(bravoToken.getLexTokens()).thenReturn(new String[]{"b", "bravo"});
    final WhateverKeyDefToken unknownToken = mock(WhateverKeyDefToken.class);
    when(unknownToken.getLexTokens()).thenReturn(new String[]{"?"});
    final WhateverKeyDefToken[] tokens = new WhateverKeyDefToken[]{alphaToken, bravoToken, unknownToken};
    for (WhateverKeyDefToken token : tokens) {
        doCallRealMethod().when(token).nonUnknown();
        doCallRealMethod().when(token).getToken();
        doCallRealMethod().when(token).readTo(any(NamePathResolver.class), any(Map.class), any(JsonValue.class));
    }
    JsonCnd.internalReadAllTo(resolver, builder, parentValue, tokens);
    assertTrue("contains alphaVal key", builder.containsKey("alphaVal"));
    assertEquals("associated alpha token", "a", builder.get("alphaVal"));
    assertTrue("contains bravoVal key", builder.containsKey("bravoVal"));
    assertEquals("associated bravo token", "b", builder.get("bravoVal"));
    assertFalse("not contains unknownVal key", builder.containsKey("unknownVal"));
}