code: private List<String> copyToList(Collection<String> collection) {
   
          if ((collection == null) || collection.isEmpty()) {
              return null;
          }
  
         return Collections.unmodifiableList(new ArrayList<String>(collection));
      }
docs: (to make state saving a bit easier).