package com.example.app1;

import io.dropwizard.views.View;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import java.util.HashMap;
import java.util.Map;
import java.util.OptionalInt;

@Path("/")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public class App1Resource {
    @GET
    @Path("empty-optional")
    public OptionalInt emptyOptional() {
        return OptionalInt.empty();
    }

    @GET
    @Path("view-with-missing-tpl")
    @Produces(MediaType.TEXT_HTML)
    public View getMissingTemplateView() {
        return new View("not-found.mustache") {
        };
    }

    @POST
    @Path("mapper")
    public Map<String, String> postMapper(Map<String, String> map) {
        final Map<String, String> resultMap = new HashMap<>(map);
        resultMap.put("hello", "world");
        return resultMap;
    }

    @GET
    @Path("custom-class")
    public CustomClass newCustomClass() {
        return new CustomClass();
    }
}

@@ -221,16 +221,48 @@
 iaType;%0A
+import java.util.LinkedHashMap;%0A
 import j
@@ -905,16 +905,22 @@
 p = new 
+Linked
 HashMap%3C

Use LinkedHashMap in App1Resource for deterministic iterations (#3103)