GeoJsonPointReverseArrayBolt extends AbstractProcessingBolt { String reverseJsonArray(String src) { Gson gson = new Gson(); List list = gson.fromJson(src, List.class); if (CollectionUtils.isEmpty(list)) { return StringUtils.EMPTY; } else { Collections.reverse(list); return gson.toJson(list); } }  @Override void configure(Configuration conf); static final String SRC_FIELD; static final String DEST_FIELD; }
@Test public void testReverseJsonArray() throws Exception { assertThat(bolt.reverseJsonArray(""), is("")); assertThat(bolt.reverseJsonArray(null), is("")); assertThat(bolt.reverseJsonArray("[1.01,2.02]"), is("[2.02,1.01]")); }