Prototype: copyTags(List<String>) -> List<String> returns a fresh mutable copy preserving exact order and duplicates. Mutating either copy afterwards must not affect the other; strings are nonnull.
Final: freeze(String name,List<String> tags) -> Snapshot requires nonnull nonempty name (IllegalArgumentException otherwise), preserves tag order/duplicates, and retains a detached unmodifiable list. Snapshot's generated accessors/equality are used directly. Mutation of source after return must not affect snapshot; tag mutation through the accessor must throw UnsupportedOperationException. Empty tags valid; null tags/elements outside domain.
Complete the starter code, then run the checks.
Results and errors will appear here.
Java runs on this device with CheerpJ 4.3.