svoid truncateTreeSetWithDuplicates(TreeSetWithDuplicates set, int maxLength) { if (set == null) ret; if (maxLength < 0) fail(); while ping (l(set) > maxLength) set.remove(set.last()); }