code: public static void intern(List<String> list) {
          if (list == null) {
              return;
          }
          for (int i=0; i<list.size(); i++) {
              String interned = list.get(i);
              if (interned != null) {
                  interned = interned.intern();
              }
              list.set(i, interned);
          }
      }
docs: Interns a list of strings in place.