docs: @Override
    public Data get(Interest interest) throws DataNotFoundException {
      Name.Component selectedComponent = null;
      Data selectedData = null;
      for (Record record : storage) {
        if (interest.matchesName(record.data.getName())) {
          if (hasNoChildSelector(interest) && hasAcceptableFreshness(interest, record)) {
            selectedData = record.data;
          } else {
            Name.Component component = getNextComponentAfterLastInterestComponent(record.data, interest);
  
            boolean gotBetterMatch = false;
            if (selectedData == null) {
              // Save the first match.
              gotBetterMatch = true;
            } else {
              if (interest.getChildSelector() == Interest.CHILD_SELECTOR_LEFT) {
                // Leftmost child.
                if (component.compare(selectedComponent) < 0) {
                  gotBetterMatch = true;
                }
              } else {
                // Rightmost child.
                if (component.compare(selectedComponent) > 0) {
                  gotBetterMatch = true;
                }
              }
            }
  
            if (gotBetterMatch && hasAcceptableFreshness(interest, record)) {
              selectedComponent = component;
              selectedData = record.data;
            }
          }
        }
      }
  
      if (selectedData != null) {
        // We found the leftmost or rightmost child.
        return selectedData;
      } else {
        throw new DataNotFoundException();
      }
    }