@Override
        public Relationship get(int index) {
            Path current = this;
            for (int i = 0; i < index; i++) {
                current = current.next;
                if (current == null) {
                    throw new IndexOutOfBoundsException("Invalid index " + index + "; size " + size());
                }
            }
            return current.value;
        }
An immutable {@code Relationship} path from a starting shape to an end shape.
smithy-model/src/main/java/software/amazon/smithy/model/selector/PathFinder.java