presto-matching/src/main/java/io/prestosql/matching/Captures.java/Captures/equals
class Captures:    @Override
    public boolean equals(Object o)
    {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        Captures captures = (Captures) o;

        if (capture != null ? !capture.equals(captures.capture) : captures.capture != null) {
            return false;
        }
        if (value != null ? !value.equals(captures.value) : captures.value != null) {
            return false;
        }
        return tail != null ? tail.equals(captures.tail) : captures.tail == null;
    }