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]
JDK 25
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
Original Set: [1, 4, 7]
java.lang.UnsupportedOperationException
at java.util.Collections$UnmodifiableCollection.add (Collections.java:1093)
at com.logicbig.example.collections.UnmodifiableSortedSetExample2.main (UnmodifiableSortedSetExample2.java:21)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:104)
at java.lang.reflect.Method.invoke (Method.java:565)
at org.codehaus.mojo.exec.AbstractExecJavaBase.executeMainMethod (AbstractExecJavaBase.java:402)
at org.codehaus.mojo.exec.ExecJavaMojo.executeMainMethod (ExecJavaMojo.java:142)
at org.codehaus.mojo.exec.AbstractExecJavaBase.doExecClassLoader (AbstractExecJavaBase.java:377)
at org.codehaus.mojo.exec.AbstractExecJavaBase.lambda$execute$0 (AbstractExecJavaBase.java:287)
at java.lang.Thread.run (Thread.java:1474)
JDK 25