buf.close();
// then as an array:
buf = new TokenBuffer(mapper, false);
buf.writeStartArray();
buf.writeBoolean(true);
buf.writeEndArray();
json = mapper.writeValueAsString(new ObjectHolder(buf));
holder = mapper.readValue(json, ObjectHolder.class);
assertNotNull(holder.value);
assertSame(TokenBuffer.class, holder.value.getClass());