code: private void getLeafNodes(N node, List<E> result, int currentLevel) {
      // Level 1 are the leaf nodes, Level 2 is the one atop!
      if(currentLevel == 2) {
        for(int i = 0; i < node.getNumEntries(); i++) {
          result.add(node.getEntry(i));
        }
      }
      else {
        for(int i = 0; i < node.getNumEntries(); i++) {
          getLeafNodes(getNode(node.getEntry(i)), result, (currentLevel - 1));
        }
      }
    }
docs: Determines the entries pointing to the leaf nodes of the specified subtree.
  
  @param node the subtree
  @param result the result to store the ids in
  @param currentLevel the level of the node in the R-Tree