java/core/src/main/java/se/lth/cs/docria/Layer.java
/**
     * Sorts nodes in this layer by the given comparator, compacts the collection pre sorting.
     * @param comparator the comparator to use for sorting
     * @return this instance
     */
Sorts nodes in this layer by the given comparator, compacts the collection pre sorting.
@param comparator the comparator to use for sorting
@return this instance
Sorts nodes in this layer by the given comparator compacts the collection pre sorting . @param comparator the comparator to use for sorting @return this instance
public Layer sort(Comparator<Node> comparator) {
        compact();
        storage.subList(0, size).sort(comparator);
        return this;
    }
public Layer sort ( Comparator < Node > comparator ) { compact ( ) ; storage . subList ( 0 , size ) . sort ( comparator ) ; return this ; }
Sorts nodes in this layer by the given comparator, compacts the collection pre sorting.
Sorts nodes in this layer by the given comparator compacts the collection pre sorting .