### Question:
ExperienceParser { public static Gson createGson(Context context) { if (gson == null) { GsonBuilder builder = new GsonBuilder(); if (context == null || Feature.get(context, R.bool.feature_load_old_experiences).isEnabled()) { builder.registerTypeAdapterFactory(new ExperienceTypeAdapterFactor()); } gson = builder.create(); } return gson; }  static Gson createGson(Context context);  }### Answer:
@SuppressLint("Assert") @Test public void testExperienceRoundTrip() throws IOException { final Experience experience = new Experience(); final Action action = new Action(); experience.getActions().add(action); final Gson gson = ExperienceParser.createGson(null); final String json1 = gson.toJson(experience); final Experience parsed = gson.fromJson(json1, Experience.class); final String json2 = gson.toJson(parsed); assert json1.equals(json2); }
@Test public void loadingOldParseTest() throws IOException { Experience experience = TestUtils.loadExperience("test_old"); Assert.assertTrue(experience.getName().equals("Test")); final Gson gson = ExperienceParser.createGson(null); System.out.println(gson.toJson(experience)); }