@Test public void encode() { Foo f1 = new Foo("foo"); Foo f2 = new Foo("bar"); FooCodec codec = new FooCodec(); ImmutableList<Foo> entities = ImmutableList.of(f1, f2); ArrayNode json = codec.encode(entities, new TestContext()); List<Foo> foos = codec.decode(json, new TestContext()); assertEquals("incorrect encode/decode", entities, foos); }
public ObjectNode encode(T entity, CodecContext context) { throw new UnsupportedOperationException("encode() not supported"); }
JsonCodec { public ObjectNode encode(T entity, CodecContext context) { throw new UnsupportedOperationException("encode() not supported"); } }
JsonCodec { public ObjectNode encode(T entity, CodecContext context) { throw new UnsupportedOperationException("encode() not supported"); }  }
JsonCodec { public ObjectNode encode(T entity, CodecContext context) { throw new UnsupportedOperationException("encode() not supported"); }  ObjectNode encode(T entity, CodecContext context); T decode(ObjectNode json, CodecContext context); ArrayNode encode(Iterable<T> entities, CodecContext context); List<T> decode(ArrayNode json, CodecContext context); }
JsonCodec { public ObjectNode encode(T entity, CodecContext context) { throw new UnsupportedOperationException("encode() not supported"); }  ObjectNode encode(T entity, CodecContext context); T decode(ObjectNode json, CodecContext context); ArrayNode encode(Iterable<T> entities, CodecContext context); List<T> decode(ArrayNode json, CodecContext context);  }