@Override
    public boolean equals(Object o) {

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

        LogicalStateElement that = (LogicalStateElement) o;

        if (streamStateElement1 != null ? !streamStateElement1.equals(that.streamStateElement1) : that
                .streamStateElement1 != null) {
            return false;
        }
        if (streamStateElement2 != null ? !streamStateElement2.equals(that.streamStateElement2) : that
                .streamStateElement2 != null) {
            return false;
        }
        if (type != that.type) {
            return false;
        }
        return true;
    }
Logical state element used in pattern to handle logical operations
modules/siddhi-query-api/src/main/java/io/siddhi/query/api/execution/query/input/state/LogicalStateElement.java