public int getStreamCount(String streamId) {

        int count = 0;
        for (String aStreamId : streamIdList) {
            if (streamId.equals(aStreamId)) {
                count++;
            }
        }
        return count;
    }
Input stream that handle states in query
modules/siddhi-query-api/src/main/java/io/siddhi/query/api/execution/query/input/stream/StateInputStream.java