public static <E> List<E> decorate(List<E> list) {
        if (list instanceof Unmodifiable) {
            return list;
        }
        return new UnmodifiableList<E>(list);
    }
Factory method to create an unmodifiable list.

@param list the list to decorate, must not be null
@throws IllegalArgumentException if list is null
jphp-runtime/src/php/runtime/common/collections/list/UnmodifiableList.java