public List<Integer> findLongestMatch(String key) {
        TST current;
        List<Integer> ordinals;
        do {
            current = prefixIndexVolatile;
            long nodeIndex = current.findLongestMatch(key);
            ordinals = current.getOrdinals(nodeIndex);
        } while (current != this.prefixIndexVolatile);
        return ordinals;
    }
@Test
    public void testLongestPrefixMatch() throws Exception {
        // "The Matrix"
        // "Blood Diamond"
        // "Rush"
        // "Rocky"
        // "The Matrix Reloaded"
        // "The Matrix Resurrections"
        for (Movie movie : getSimpleList()) {
            objectMapper.add(movie);
        }
        StateEngineRoundTripper.roundTripSnapshot(writeStateEngine, readStateEngine);
        HollowTokenizedPrefixIndex tokenizedPrefixIndex = new HollowTokenizedPrefixIndex(readStateEngine, "SimpleMovie", "name.value", false);

        List<Integer> match;
        match = tokenizedPrefixIndex.findLongestMatch("rush");
        Assert.assertTrue(match.get(0) > -1);

        match = tokenizedPrefixIndex.findLongestMatch("rushing");
        Assert.assertTrue(match.get(0) > -1);

        match = tokenizedPrefixIndex.findLongestMatch("the");
        Assert.assertTrue(match.get(0) > -1);

        match = tokenizedPrefixIndex.findLongestMatch("doesnotexist");
        Assert.assertTrue(match.size() == 0);

        match = tokenizedPrefixIndex.findLongestMatch("resurrect");
        Assert.assertTrue(match.size() == 0);

        match = tokenizedPrefixIndex.findLongestMatch("");  // empty string is not indexed in prefix index but supported in hollow type state
        Assert.assertTrue(match.size() == 0);

        match = tokenizedPrefixIndex.findLongestMatch(null); // null value is not supported in hollow type state
        Assert.assertTrue(match.size() == 0);
    }