code: public static JSONArray getArray(JSONValue value) {
          if (value == null)
              return null;
          if (!(value instanceof JSONArray))
              throw new JSONException(NOT_AN_ARRAY);
          return (JSONArray)value;
      }
docs: Get a {@link JSONArray} from a {@link JSONValue}.  Return {@code null} if the
  {@link JSONValue} is {@code null}.
  
  @param   value   the {@link JSONValue}
  @return  the value as a {@link JSONArray}
  @throws  JSONException if the value is not an array