JsonSliceUtil { static boolean isNextIsEndArray(List<JsonSlice> slices, int index) { if (slices.size() <= index + 1) { return false; } else { return slices.get(index + 1).getState() == State.END_ARRAY; } }  static String slicesToString(List<JsonSlice> slices);  }
@Test public void isNextIsEndArray() { List<JsonSlice> slices; slices = new ArrayList<JsonSlice>(); slices.add(new JsonSlice(State.START_ARRAY)); slices.add(new JsonSlice(State.END_ARRAY)); assertThat(JsonSliceUtil.isNextIsEndArray(slices, 0), is(true)); slices = new ArrayList<JsonSlice>(); slices.add(new JsonSlice(State.START_ARRAY)); assertThat(JsonSliceUtil.isNextIsEndArray(slices, 0), is(false)); slices = new ArrayList<JsonSlice>(); slices.add(new JsonSlice(State.START_ARRAY)); slices.add(new JsonSlice(State.START_HASH)); assertThat(JsonSliceUtil.isNextIsEndArray(slices, 0), is(false)); }