code: private static Object saveList(List<String> list) {
          if ((list == null) || list.isEmpty()) {
              return null;
          }
  
          int size = list.size();
  
          if (size == 1) {
              return list.get(0);
          }
  
          return list.toArray(new String[size]);
      }
docs: a String[] (multiple elements.