@Override
    public boolean equals(Object o) {

        if (this == o) {
            return true;
        }
        if (!(o instanceof StateInputStream)) {
            return false;
        }

        StateInputStream that = (StateInputStream) o;

        if (stateType != that.stateType) {
            return false;
        }
        if (stateElement != null ? !stateElement.equals(that.stateElement) : that.stateElement != null) {
            return false;
        }
        if (streamIdList != null ? !streamIdList.equals(that.streamIdList) : that.streamIdList != null) {
            return false;
        }
        return withinTime != null ? withinTime.equals(that.withinTime) : that.withinTime == null;
    }
Input stream that handle states in query
modules/siddhi-query-api/src/main/java/io/siddhi/query/api/execution/query/input/stream/StateInputStream.java