@Nonnull
private static <T> SortedSet<? extends T> toSortedSet(@Nonnull Comparator<? super T> elementComparator,
@Nonnull Collection<? extends T> collection) {
if (collection instanceof SortedSet) {
SortedSet<? extends T> sortedSet = (SortedSet<? extends T>)collection;
Comparator<?> comparator = sortedSet.comparator();
if (comparator != null && comparator.equals(elementComparator)) {
return sortedSet;
}
}
return ImmutableSortedSet.copyOf(elementComparator, collection);
}
CollectionUtils.java 文件源码
java
阅读 49
收藏 0
点赞 0
评论 0
项目:andbg
作者:
评论列表
文章目录