MapCoder extends StructuredCoder<Map<K, V>> { @Override public TypeDescriptor<Map<K, V>> getEncodedTypeDescriptor() { return new TypeDescriptor<Map<K, V>>() {}.where( new TypeParameter<K>() {}, keyCoder.getEncodedTypeDescriptor()) .where(new TypeParameter<V>() {}, valueCoder.getEncodedTypeDescriptor()); } private  MapCoder(Coder<K> keyCoder, Coder<V> valueCoder); static MapCoder<K, V> of(Coder<K> keyCoder, Coder<V> valueCoder); Coder<K> getKeyCoder(); Coder<V> getValueCoder(); @Override void encode(Map<K, V> map, OutputStream outStream); @Override void encode(Map<K, V> map, OutputStream outStream, Context context); @Override Map<K, V> decode(InputStream inStream); @Override Map<K, V> decode(InputStream inStream, Context context); @Override List<? extends Coder<?>> getCoderArguments(); @Override void verifyDeterministic(); @Override boolean consistentWithEquals(); @Override Object structuralValue(Map<K, V> value); @Override void registerByteSizeObserver(Map<K, V> map, ElementByteSizeObserver observer); @Override TypeDescriptor<Map<K, V>> getEncodedTypeDescriptor();  }
@Test public void testEncodedTypeDescriptor() throws Exception { TypeDescriptor<Map<Integer, String>> typeDescriptor = new TypeDescriptor<Map<Integer, String>>() {}; assertThat(TEST_CODER.getEncodedTypeDescriptor(), equalTo(typeDescriptor)); }