Since the Set created by this method is a view of the original set, modifying the original will reflect the changes in it:

package com.logicbig.example.collections;
import java.util.Collections;
import java.util.SortedSet;
import java.util.TreeSet;
public class UnmodifiableSortedSetExample {
public static void main(String... args) {
SortedSet<Integer> set = new TreeSet<>();
Collections.addAll(set, 1, 4, 7);
System.out.println("Original Set: " + set);
SortedSet<Integer> set2 = Collections.unmodifiableSortedSet(set);
System.out.println("unmodifiableSortedSet: " + set2);
//modifying the original
set.add(10);
System.out.println("unmodifiableSortedSet: " + set2);
}
}
Output
Original Set: [1, 4, 7]
unmodifiableSortedSet: [1, 4, 7]
unmodifiableSortedSet: [1, 4, 7, 10]
Modifying itself will throw exception:

package com.logicbig.example.collections;
import java.util.Collections;
import java.util.SortedSet;
import java.util.TreeSet;
public class UnmodifiableSortedSetExample2 {
public static void main(String... args) {
SortedSet<Integer> set = new TreeSet<>();
Collections.addAll(set, 1, 4, 7);
System.out.println("Original Set: " + set);
SortedSet<Integer> set2 = Collections.unmodifiableSortedSet(set);
set2.add(10);
}
}
Output
Caused by: java.lang.UnsupportedOperationException
at java.base/java.util.Collections$UnmodifiableCollection.add(Collections.java:1056)
at com.logicbig.example.collections.UnmodifiableSortedSetExample2.main(UnmodifiableSortedSetExample2.java:21)
... 6 more