@@ -0,0 +1,1702 @@
+// Copyright 2019 Google LLC%0A//%0A// Licensed under the Apache License, Version 2.0 (the %22License%22);%0A// you may not use this file except in compliance with the License.%0A// You may obtain a copy of the License at%0A//%0A//     https://www.apache.org/licenses/LICENSE-2.0%0A//%0A// Unless required by applicable law or agreed to in writing, software%0A// distributed under the License is distributed on an %22AS IS%22 BASIS,%0A// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A// See the License for the specific language governing permissions and%0A// limitations under the License.%0A%0Apackage com.google.sps.servlets;%0A%0Aimport java.io.IOException;%0Aimport com.google.gson.Gson;%0Aimport java.util.List;%0Aimport java.util.ArrayList;%0Aimport javax.servlet.http.HttpServletRequest;%0A%0A%0Apublic class Utility %7B%0A%0A  /**%0A   * Converts an Object instance into a JSON string using the Gson library.%0A   * %0A   * @return String containing converted JSON%0A   * @param o Object to be converted to JSON%0A   */%0A  public static String convertToJson(Object o) %7B%0A    Gson gson = new Gson();%0A    String json = gson.toJson(o);%0A    return json;%0A  %7D%0A%0A  /**%0A   * @return the request parameter, or the default value if the parameter%0A   *         was not specified by the client%0A   * @param request HTTP request to get the parameter from%0A   * @param name String containing the name of the parameter to get%0A   * @param defaultValue String containing a default value to return if there is no parameter%0A   */%0A  public static String getParameter(HttpServletRequest request, String name, String defaultValue) %7B%0A    String value = request.getParameter(name);%0A    if (value == null) %7B%0A      return defaultValue;%0A    %7D%0A    return value;%0A  %7D%0A%7D%0A

Add Utility class for useful functions