code: public static boolean ensureJsonPrimitiveKeys(Map map)
      {
          for (Object o : map.keySet())
          {
              if (!(o instanceof String))
              {
                  return false;
              }
          }
          return true;
      }
docs: Ensure that all keys within the Map are String instances
  @param map Map to inspect that all keys are primitive.  This allows the output JSON
  to be optimized into {"key1":value1, "key2": value2} format if all the
  keys of the Map are Strings.  If not, then a Map is written as two
  arrays, an @keys array and an @items array.  This allows support for Maps
  with non-String keys.