UnionCoder extends StructuredCoder<RawUnionValue> { public List<? extends Coder<?>> getElementCoders() { return elementCoders; } private  UnionCoder(List<Coder<?>> elementCoders); static UnionCoder of(List<Coder<?>> elementCoders); @Override void encode(RawUnionValue union, OutputStream outStream); @SuppressWarnings("unchecked") @Override void encode(RawUnionValue union, OutputStream outStream, Context context); @Override RawUnionValue decode(InputStream inStream); @Override RawUnionValue decode(InputStream inStream, Context context); @Override List<? extends Coder<?>> getCoderArguments(); @Override List<? extends Coder<?>> getComponents(); List<? extends Coder<?>> getElementCoders(); @Override boolean isRegisterByteSizeObserverCheap(RawUnionValue union); @Override void registerByteSizeObserver(RawUnionValue union, ElementByteSizeObserver observer); @Override void verifyDeterministic();  }
@Test public void testGetElementCoders() { UnionCoder unionCoder = UnionCoder.of(ImmutableList.of(StringUtf8Coder.of(), DoubleCoder.of())); assertThat(unionCoder.getElementCoders().get(0), Matchers.equalTo(StringUtf8Coder.of())); assertThat(unionCoder.getElementCoders().get(1), Matchers.equalTo(DoubleCoder.of())); }