I would like to do something like:
final unmodifiableList1 = staticMethodForUnmodifiableList(1,2,3,4);
final unmodifiableList2 = unmodifiableList1.createAndAdd(5);
System.out.println(unmodifiableList1); // prints 1, 2, 3, 4
System.out.println(unmodifiableList2); // prints 1, 2, 3, 4, 5
I have implemented my own solution, but now I realize I would like to have this class in other companies, where I can't reuse my own solution and now I'm thinking if this exist's in any Open Source Library that I could use.
Same would be nice to have for methods like subList and for other collections like unmodifiable Maps, Sets etc.
Best Regards