closeable utils sortedDistinct