The problem with using Collections.unmodifiableList is that you're not really creating a read-only view on mutable collection, not real immutable collection. It might seem like it's not a big deal, but in reality, the mutable collection acting as immutable won't be very efficient and performant. For example, appending the new element to the list would require copying the whole list.
I would suggest you check out Vavr. It has its own implementation of functional, immutable linked list, which allows you to do appends on constant time (which doesn't require copying whole list, because common elements are shared). For example:
var l1 = List.of(1, 2, 3); //List(1, 2, 3)
var l2 = l1.append(4); //List(1, 2, 3, 4)
In this example both list would share 1,2,3.
You can also convert from and to Java List easily:
java.util.List<String> javaList = Arrays.asList("Java", "Haskell", "Scala");
List<String> vavrList = List.ofAll(javaList);
List<String> vavrStringList = List.of("JAVA", "Javascript", "Scala");
java.util.List<String> javaStringList = vavrStringList.toJavaList();
Arrays.asList.Lists"List. The inlined syntax, whether you useArrays.asList(0,1,2,3)orArrays.asList(new Integer[] {0,1,2,3})ensures that no other reference to the array exists. Since that’s the right approach, I wouldn’t presume that the OP didn’t understand this. That’s not recognizable from the question.