@@ -0,0 +1,1222 @@
+package nl.dvberkel;%0A%0Aimport com.google.gson.Gson;%0Aimport nl.dvberkel.dyck.State;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.junit.runners.Parameterized;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Collection;%0A%0Aimport static org.hamcrest.CoreMatchers.is;%0Aimport static org.junit.Assert.assertThat;%0A%0A@RunWith(Parameterized.class)%0Apublic class GsonStateTest %7B%0A    private final State original;%0A    private Gson gson;%0A%0A    public GsonStateTest(State original) %7B%0A        this.original = original;%0A    %7D%0A%0A    @Parameterized.Parameters%0A    public static Collection%3CObject%5B%5D%3E data() %7B%0A        ArrayList%3CObject%5B%5D%3E data = new ArrayList%3CObject%5B%5D%3E();%0A        data.add(new Object%5B%5D%7B new State(%22%22, 0) %7D);%0A        data.add(new Object%5B%5D%7B new State(%22()%22, 0) %7D);%0A        data.add(new Object%5B%5D%7B new State(%22()()%22, 0) %7D);%0A        data.add(new Object%5B%5D%7B new State(new State(%22()()%22, 3), %22(())%22, 0) %7D);%0A        return data;%0A    %7D%0A%0A    @Before()%0A    public void createGson() %7B%0A        gson = new Gson();%0A    %7D%0A%0A    @Test%0A    public void shouldSurviveAfterGsonRoundTrip() %7B%0A        String json = gson.toJson(original);%0A%0A        assertThat(gson.fromJson(json, State.class), is(original));%0A    %7D%0A%7D%0A

Create a Gson Test