@Override
    protected RecordIterator<Object[]> query(Map<String, Object> parameterMap, CompiledCondition compiledCondition,
                                             CompiledSelection compiledSelection, Attribute[] outputAttributes) {
        StreamEvent outEvent = inMemoryTable.find(compiledCondition, findMatchingEvent);
        List<Object[]> objects = new LinkedList<>();
        CompiledSelectionWithCache compiledSelectionWithCache = null;

        if (outEvent != null) {
            compiledSelectionWithCache = (CompiledSelectionWithCache) compiledSelection;
            StateEventFactory stateEventFactory = new StateEventFactory(compiledSelectionWithCache.getMetaStateEvent());
            Event[] cacheResultsAfterSelection = executeSelector(stateEventFactory, null, outEvent,
                    compiledSelectionWithCache.getStoreEventIndex(), compiledSelectionWithCache.getQuerySelector());

            if (compiledSelectionWithCache.getQuerySelector() != null &
                    compiledSelectionWithCache.getQuerySelector().getAttributeProcessorList().size() != 0) {
                compiledSelectionWithCache.getQuerySelector().
                        process(generateResetComplexEventChunk(outEvent.getOutputData().length, stateEventFactory));
            }
            if (cacheResultsAfterSelection != null) {
                for (Event event : cacheResultsAfterSelection) {
                    objects.add(event.getData());
                }
            }
        }
        return new TestStoreWithCacheIterator(objects.iterator());
    }
Custom store for testing of in memory cache for store tables.
modules/siddhi-core/src/test/java/io/siddhi/core/query/table/util/TestStoreForCacheMiss.java