// Path: src/main/java/com/thoughtworks/go/strongauth/util/Json.java
// public class Json {
//     private static Gson gson = new Gson();
// 
//     public static Map<String, String> toMapOfStrings(String jsonValue) {
//         Type mapOfStringToStringType = new TypeToken<LinkedTreeMap<String, String>>() {}.getType();
//         return gson.fromJson(jsonValue, mapOfStringToStringType);
//     }
// 
//     public static Map toMap(String jsonValue) {
//         return gson.fromJson(jsonValue, Map.class);
//     }
// 
//     public static String toJson(Object anything) {
//         return gson.toJson(anything);
//     }
// }


import com.google.common.collect.ImmutableMap;
import com.thoughtworks.go.plugin.api.response.DefaultGoPluginApiResponse;
import com.thoughtworks.go.plugin.api.response.GoPluginApiResponse;
import com.thoughtworks.go.strongauth.util.Json;
package com.thoughtworks.go.strongauth.wire;


public class GoUserEncoder {

    public GoPluginApiResponse encode(final String username) {
        final DefaultGoPluginApiResponse response = new DefaultGoPluginApiResponse(200);
        final ImmutableMap<String, ImmutableMap<String, String>> map =
                ImmutableMap.of("user", ImmutableMap.of("username", username));
// Path: src/main/java/com/thoughtworks/go/strongauth/util/Json.java
// public class Json {
//     private static Gson gson = new Gson();
// 
//     public static Map<String, String> toMapOfStrings(String jsonValue) {
//         Type mapOfStringToStringType = new TypeToken<LinkedTreeMap<String, String>>() {}.getType();
//         return gson.fromJson(jsonValue, mapOfStringToStringType);
//     }
// 
//     public static Map toMap(String jsonValue) {
//         return gson.fromJson(jsonValue, Map.class);
//     }
// 
//     public static String toJson(Object anything) {
//         return gson.toJson(anything);
//     }
// }


// Path: src/main/java/com/thoughtworks/go/strongauth/wire/GoUserEncoder.java
import com.google.common.collect.ImmutableMap;
import com.thoughtworks.go.plugin.api.response.DefaultGoPluginApiResponse;
import com.thoughtworks.go.plugin.api.response.GoPluginApiResponse;
import com.thoughtworks.go.strongauth.util.Json;

package com.thoughtworks.go.strongauth.wire;


public class GoUserEncoder {

    public GoPluginApiResponse encode(final String username) {
        final DefaultGoPluginApiResponse response = new DefaultGoPluginApiResponse(200);
        final ImmutableMap<String, ImmutableMap<String, String>> map =
                ImmutableMap.of("user", ImmutableMap.of("username", username));
        response.setResponseBody(Json.toJson(map));