@Test
public void slicesToString_array() throws JsonFormatException, IOException {

	List<JsonSlice> slices;
	String json;
	slices = new ArrayList<JsonSlice>();
	slices.add(new JsonSlice(State.START_ARRAY));
	slices.add(new JsonSlice(State.END_ARRAY));
	json = JsonSliceUtil.slicesToString(slices);
	assertThat(json, is("[]"));
	slices = new ArrayList<JsonSlice>();
	slices.add(new JsonSlice(State.START_ARRAY));
	slices.add(new JsonSlice(State.START_HASH));
	slices.add(new JsonSlice(State.END_HASH));
	slices.add(new JsonSlice(State.END_ARRAY));
	json = JsonSliceUtil.slicesToString(slices);
	assertThat(json, is("[{}]"));
	slices = new ArrayList<JsonSlice>();
	slices.add(new JsonSlice(State.START_ARRAY));
	slices.add(new JsonSlice(State.START_HASH));
	slices.add(new JsonSlice(State.KEY, "hoge"));
	slices.add(new JsonSlice(State.VALUE_BOOLEAN, true));
	slices.add(new JsonSlice(State.END_HASH));
	slices.add(new JsonSlice(State.END_ARRAY));
	json = JsonSliceUtil.slicesToString(slices);
	assertThat(json, is("[{\"hoge\":true}]"));
	slices = new ArrayList<JsonSlice>();
	slices.add(new JsonSlice(State.START_ARRAY));
	slices.add(new JsonSlice(State.START_HASH));
	slices.add(new JsonSlice(State.KEY, "hoge"));
	slices.add(new JsonSlice(State.VALUE_BOOLEAN, true));
	slices.add(new JsonSlice(State.KEY, "fuga"));
	slices.add(new JsonSlice(State.VALUE_NULL));
	slices.add(new JsonSlice(State.END_HASH));
	slices.add(new JsonSlice(State.END_ARRAY));
	json = JsonSliceUtil.slicesToString(slices);
	assertThat(json, is("[{\"hoge\":true,\"fuga\":null}]"));
	slices = new ArrayList<JsonSlice>();
	slices.add(new JsonSlice(State.START_ARRAY));
	slices.add(new JsonSlice(State.START_HASH));
	slices.add(new JsonSlice(State.KEY, "hoge"));
	slices.add(new JsonSlice(State.VALUE_BOOLEAN, true));
	slices.add(new JsonSlice(State.KEY, "fuga"));
	slices.add(new JsonSlice(State.VALUE_NULL));
	slices.add(new JsonSlice(State.END_HASH));
	slices.add(new JsonSlice(State.START_ARRAY));
	slices.add(new JsonSlice(State.END_ARRAY));
	slices.add(new JsonSlice(State.END_ARRAY));
	json = JsonSliceUtil.slicesToString(slices);
	assertThat(json, is("[{\"hoge\":true,\"fuga\":null},[]]"));
	slices = new ArrayList<JsonSlice>();
	slices.add(new JsonSlice(State.START_ARRAY));
	slices.add(new JsonSlice(State.VALUE_BOOLEAN, true));
	slices.add(new JsonSlice(State.VALUE_LONG, 1));
	slices.add(new JsonSlice(State.VALUE_DOUBLE, 2.2));
	slices.add(new JsonSlice(State.VALUE_STRING, "str"));
	slices.add(new JsonSlice(State.VALUE_NULL));
	slices.add(new JsonSlice(State.END_ARRAY));
	json = JsonSliceUtil.slicesToString(slices);
	assertThat(json, is("[true,1,2.2,\"str\",null]"));
}