WritableCoder extends CustomCoder<T> { public static <T extends Writable> WritableCoder<T> of(Class<T> clazz) { return new WritableCoder<>(clazz); } @SuppressWarnings("WeakerAccess")  WritableCoder(Class<T> type); static WritableCoder<T> of(Class<T> clazz); @Override void encode(T value, OutputStream outStream); @SuppressWarnings("unchecked") @Override T decode(InputStream inStream); @Override List<Coder<?>> getCoderArguments(); @Override void verifyDeterministic(); @Override boolean equals(@Nullable Object other); @Override int hashCode(); @SuppressWarnings("WeakerAccess") static CoderProvider getCoderProvider();  }
@Test public void testIntWritableEncoding() throws Exception { IntWritable value = new IntWritable(42); WritableCoder<IntWritable> coder = WritableCoder.of(IntWritable.class); CoderProperties.coderDecodeEncodeEqual(coder, value); }
@Test public void testNullWritableEncoding() throws Exception { NullWritable value = NullWritable.get(); WritableCoder<NullWritable> coder = WritableCoder.of(NullWritable.class); CoderProperties.coderDecodeEncodeEqual(coder, value); }