Optimized CustomComparator, Setting and TimeWindow