SerializableCoder extends CustomCoder<T> { protected SerializableCoder(Class<T> type, TypeDescriptor<T> typeDescriptor) { this.type = type; this.typeDescriptor = typeDescriptor; } protected  SerializableCoder(Class<T> type, TypeDescriptor<T> typeDescriptor); static SerializableCoder<T> of(TypeDescriptor<T> type); @Override boolean consistentWithEquals(); @Override Object structuralValue(T value); static SerializableCoder<T> of(Class<T> clazz); @SuppressWarnings("unused") static CoderProvider getCoderProvider(); Class<T> getRecordType(); @Override void encode(T value, OutputStream outStream); @Override T decode(InputStream inStream); @Override void verifyDeterministic(); @Override boolean equals(@Nullable Object other); @Override int hashCode(); @Override TypeDescriptor<T> getEncodedTypeDescriptor(); @Override String toString();  }
@Test public void testSerializableCoder() throws Exception { IterableCoder<MyRecord> coder = IterableCoder.of(SerializableCoder.of(MyRecord.class)); List<MyRecord> records = new ArrayList<>(); for (String l : LINES) { records.add(new MyRecord(l)); } byte[] encoded = CoderUtils.encodeToByteArray(coder, records); Iterable<MyRecord> decoded = CoderUtils.decodeFromByteArray(coder, encoded); assertEquals(records, decoded); }