question: public Partitions prunePartitions ( Set < String > validPartitions ) { if ( validPartitions != null && ! validPartitions . isEmpty ( ) ) { partitions . retainAll ( validPartitions ) ; } return this ; }
target:  Prunes this instance so that it retains only the partitions included in  the given set. No operation takes place if the given set is null or empty.