Returns the {@link Comparator} used. @throws UnsupportedOperationException if comparator is not defined
()
| 150 | * @throws UnsupportedOperationException if comparator is not defined |
| 151 | */ |
| 152 | public Comparator<T> comparator() { |
| 153 | if (comparator != null) { |
| 154 | return comparator; |
| 155 | } |
| 156 | throw new UnsupportedOperationException("This ordering does not define a comparator."); |
| 157 | } |
| 158 | |
| 159 | @Override |
| 160 | public boolean equals(@Nullable Object obj) { |