presto-matching/src/main/java/io/prestosql/matching/Captures.java/Captures/get
class Captures:    @SuppressWarnings("unchecked cast")
    public <T> T get(Capture<T> capture)
    {
        if (this.equals(NIL)) {
            throw new NoSuchElementException("Requested value for unknown Capture. Was it registered in the Pattern?");
        }
        else if (this.capture.equals(capture)) {
            return (T) value;
        }
        else {
            return tail.get(capture);
        }
    }