@@ -0,0 +1,2884 @@
+package com.fasterxml.jackson.core.json.async;%0A%0Aimport com.fasterxml.jackson.core.*;%0Aimport com.fasterxml.jackson.core.async.AsyncTestBase;%0Aimport com.fasterxml.jackson.core.async.NonBlockingInputFeeder;%0Aimport com.fasterxml.jackson.core.filter.FilteringParserDelegate;%0Aimport com.fasterxml.jackson.core.filter.TokenFilter;%0Aimport com.fasterxml.jackson.core.testsupport.AsyncReaderWrapper;%0A%0Aimport java.io.ByteArrayOutputStream;%0Aimport java.io.IOException;%0Aimport java.util.Arrays;%0A%0Aimport static org.junit.Assert.assertArrayEquals;%0Aimport static org.junit.Assert.assertNotEquals;%0A%0Apublic class AsyncTokenFilterTest extends AsyncTestBase %7B%0A    private final JsonFactory JSON_F = new JsonFactory();%0A%0A    private final static String INPUT_STRING = %22%7B'a': 1, 'b': %5B2, %7B'c': 3%7D%5D%7D%22.replace('%5C'', '%22');%0A    private final static byte%5B%5D INPUT_BYTES = INPUT_STRING.getBytes();%0A    private final static TokenFilter TOKEN_FILTER = new TokenFilter() %7B%0A        public TokenFilter includeProperty(String name) %7B%0A            return name == %22a%22 ? TokenFilter.INCLUDE_ALL : null;%0A        %7D%0A    %7D;%0A    private final static JsonToken%5B%5D EXPECTED_TOKENS = new JsonToken%5B%5D%7B%0A        JsonToken.START_OBJECT,%0A        JsonToken.FIELD_NAME,%0A        JsonToken.VALUE_NUMBER_INT,%0A        JsonToken.END_OBJECT%0A    %7D;%0A%0A    public void testFilteredNonBlockingParser() throws IOException %7B%0A        // Start by feeding all the bytes at once, since that works fine, and gradually reduce the chunk size.%0A        for (int chunkSize = INPUT_BYTES.length; chunkSize %3E 0; chunkSize--) %7B%0A            System.out.println(%22Starting chunkSize %22 + chunkSize);%0A            // Create the parsers%0A            NonBlockingJsonParser nonBlockingParser = (NonBlockingJsonParser) JSON_F.createNonBlockingByteArrayParser();%0A            FilteringParserDelegate filteredParser = new FilteringParserDelegate(nonBlockingParser, TOKEN_FILTER, true, true);%0A%0A            int expectedIdx = 0; // tracks EXPECTED_TOKENS seen%0A            int inputIdx = 0; // tracks INPUT_BYTES fed to the parser%0A%0A            while (expectedIdx %3C EXPECTED_TOKENS.length) %7B%0A                // grab next token%0A                JsonToken actual = filteredParser.nextToken();%0A%0A                if (actual == JsonToken.NOT_AVAILABLE) %7B%0A                    // feed it.%0A                    int chunkLen = Math.min(inputIdx + chunkSize, INPUT_BYTES.length - inputIdx);%0A                    assertNotEquals(0, chunkLen); // sanity check.%0A                    nonBlockingParser.feedInput(INPUT_BYTES, inputIdx, inputIdx + chunkLen);%0A                    inputIdx += chunkLen;%0A                %7D else %7B%0A                    // make sure it's the right one and mark it as seen.%0A                    JsonToken expected = EXPECTED_TOKENS%5BexpectedIdx%5D;%0A                    assertEquals(expected, actual);%0A                    expectedIdx++;%0A                %7D%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

Add failing AsyncTokenFilterTest.