code: public JSONArray switchesToJSON(Collection<Switch> c) {
          JSONArray a = new JSONArray();
          for (Switch s : c) {
              a.add(switchToJSON(s));
          }
          return a;
      }
docs: Convert a collection of switches to an array of JSON switches objects.
  
  @param c the collection of Switches
  @return a json formatted array of Switches