code: private static CmsCategoryTreeEntry findCategory(List<CmsCategoryTreeEntry> tree, String path) {
  
          if (path == null) {
              return null;
          }
          // we assume that the category to find is descendant of tree
          List<CmsCategoryTreeEntry> children = tree;
          boolean found = true;
          while (found) {
              if (children == null) {
                  return null;
              }
              // since the categories are sorted it is faster to go backwards
              found = false;
              for (int i = children.size() - 1; i >= 0; i--) {
                  CmsCategoryTreeEntry child = children.get(i);
                  if (path.equals(child.getPath())) {
                      return child;
                  }
                  if (path.startsWith(child.getPath())) {
                      children = child.getChildren();
                      found = true;
                      break;
                  }
              }
          }
          return null;
      }
docs: FInds a category in the given tree.<p>
  
  @param tree the the tree to search in
  @param path the path to search for
  
  @return the category with the given path or <code>null</code> if not found