Analyze extends GenericResultAbstractAction { @Override public String getData(Gson gson) { return gson.toJson(payload, Map.class); } protected  Analyze(Builder builder); @Override String getRestMethodName(); @Override String getData(Gson gson);  }
@Test public void testPayloadWithAListTextEntry() throws Exception { Analyze analyze = new Analyze.Builder() .text(ImmutableList.of("foo", "bar")) .text("baz") .build(); String expectedJSON = "{\n" + "\"filter\": [],\n" + "\"text\": [\"foo\", \"bar\", \"baz\"]\n" + "}"; JSONAssert.assertEquals(expectedJSON, analyze.getData(new Gson()), false); }