ImmutableListBundleFactory implements BundleFactory { @Override public <K, T> UncommittedBundle<T> createKeyedBundle( StructuralKey<K> key, PCollection<T> output) { return UncommittedImmutableListBundle.create(output, key); } private  ImmutableListBundleFactory(); static ImmutableListBundleFactory create(); @Override UncommittedBundle<T> createRootBundle(); @Override UncommittedBundle<T> createBundle(PCollection<T> output); @Override UncommittedBundle<T> createKeyedBundle(
      StructuralKey<K> key, PCollection<T> output);  }
@Test public void keyedWithNullKeyShouldCreateKeyedBundle() throws Exception { createKeyedBundle(VoidCoder.of(), null); }
@Test public void keyedWithStringKeyShouldCreateKeyedBundle() throws Exception { createKeyedBundle(StringUtf8Coder.of(), "foo"); }
@Test public void keyedWithVarIntKeyShouldCreateKeyedBundle() throws Exception { createKeyedBundle(VarIntCoder.of(), 1234); }
@Test public void keyedWithByteArrayKeyShouldCreateKeyedBundle() throws Exception { createKeyedBundle(ByteArrayCoder.of(), new byte[] {0, 2, 4, 99}); }
@Test public void createKeyedBundleKeyed() { CommittedBundle<KV<String, Integer>> keyedBundle = bundleFactory .createKeyedBundle(StructuralKey.of("foo", StringUtf8Coder.of()), downstream) .commit(Instant.now()); assertThat(keyedBundle.getKey().getKey(), equalTo("foo")); }