@@ -0,0 +1,1285 @@
+package com.google.research.bleth.servlets;%0A%0Aimport com.google.gson.Gson;%0Aimport com.google.gson.JsonElement;%0Aimport com.google.research.bleth.simulator.SimulationMetadata;%0A%0Aimport java.io.IOException;%0Aimport java.util.HashMap;%0Aimport javax.servlet.annotation.WebServlet;%0Aimport javax.servlet.http.HttpServlet;%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0A%0A/** A servlet used for displaying simulations. */%0A@WebServlet(%22/list-simulations%22)%0Apublic class ListSimulationsServlet extends HttpServlet %7B%0A%0A    @Override%0A    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException %7B%0A        Gson gson = new Gson(); // Used for json serialization.%0A%0A        // Read SimulationMetadata as a HashMap.%0A        HashMap%3CString, SimulationMetadata%3E simulations = SimulationMetadata.listSimulations();%0A%0A        // Serialize SimulationMetadata objects to JSON strings.%0A        HashMap%3CString, JsonElement%3E simulationsAsJson = new HashMap%3C%3E();%0A        simulations.forEach((id, metadata) -%3E simulationsAsJson.put(id, gson.toJsonTree(metadata)));%0A%0A        // Write hash map to response.%0A        response.setContentType(%22application/json;%22);%0A        response.getWriter().println(gson.toJson(simulationsAsJson));%0A    %7D%0A%7D%0A

create a servlet for listing simulations' metadata.