Seems that not even possible:
java.lang.UnsupportedOperationException
at java.util.Collections$UnmodifiableList.sort(Collections.java:1331)
at java.util.Collections.sort(Collections.java:175)
Sorry, I initially assumed may work but may not be recommended as something undocumented. However while you can add elements to the Builder
, the list that the Builder
returns is not a modifyable list.