private static Gson gson = new Gson();

public static String toJson(Object object)

{

return gson.toJson(object);

}

public static <T> T fromJson(String json, TypeToken<T> token)

{

return gson.fromJson(json, token.getType());

}