@@ -0,0 +1,743 @@
+package com.mars.test.gson;%0A%0Aimport com.google.gson.Gson;%0Aimport com.google.gson.GsonBuilder;%0Aimport com.google.gson.reflect.TypeToken;%0Aimport lombok.extern.slf4j.Slf4j;%0Aimport org.junit.Test;%0A%0Aimport java.lang.reflect.Type;%0Aimport java.util.Map;%0A%0A/**%0A * Created by USER on 2017/7/11.%0A * reference : https://stackoverflow.com/questions/2779251/how-can-i-convert-json-to-a-hashmap-using-gson%0A *%0A */%0A@Slf4j%0Apublic class TestConvertMap %7B%0A%0A    final Gson gson = new GsonBuilder().create();%0A%0A    @Test%0A    public void testConvertMap()%7B%0A        Type type = new TypeToken%3CMap%3CString, String%3E%3E()%7B%7D.getType();%0A        Map%3CString, String%3E myMap = gson.fromJson(%22%7B'k1':'apple','k2':'orange'%7D%22, type);%0A        log.info(%22test convert = %22 + myMap);%0A    %7D%0A%7D%0A

add sample