code: public JSONArray toJSONArray(JSONArray names) {
  		JSONArray result = new JSONArray();
  		if (names == null) {
  			return null;
  		}
  		int length = names.length();
  		if (length == 0) {
  			return null;
  		}
  		for (int i = 0; i < length; i++) {
  			String name = JSON.toString(names.opt(i));
  			result.put(opt(name));
  		}
  		return result;
  	}
docs: Returns an array with the values corresponding to {@code names}. The array contains
  null for names that aren't mapped. This method returns null if {@code names} is
  either null or empty.
  @param names the names of the properties
  @return the array