Goal
Deduplicate a small, repeated vocabulary using string.Intern and demonstrate that repeated values share the same reference.
Requirements
-
Given an array of tokens with repeats (e.g.,
["GET","POST","GET","PUT","GET"]), normalize each withstring.Intern. -
Show that all
"GET"entries refer to the same reference after interning. -
Count unique references before vs after interning.