Java Code Examples for java.util.Collections.checkedSortedSet()

The following are Jave code examples for showing how to use checkedSortedSet() of the java.util.Collections class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: jdk8u-jdk   File: java_util_Collections_CheckedSortedSet.java   Source Code and License Vote up 4 votes
protected SortedSet<String> getObject() {
    SortedSet<String> set = new TreeSet<String>();
    set.add("string");
    return Collections.checkedSortedSet(set, String.class);
}
 
Example 2
Project: jdk8u-jdk   File: java_util_Collections_CheckedSortedSet.java   Source Code and License Vote up 4 votes
protected SortedSet<String> getAnotherObject() {
    SortedSet<String> set = new TreeSet<String>();
    return Collections.checkedSortedSet(set, String.class);
}