ImmutabilityCheckingBundleFactory implements BundleFactory { @Override public <T> UncommittedBundle<T> createRootBundle() { return underlying.createRootBundle(); } private  ImmutabilityCheckingBundleFactory(BundleFactory underlying, DirectGraph graph); static ImmutabilityCheckingBundleFactory create(
      BundleFactory underlying, DirectGraph graph); @Override UncommittedBundle<T> createRootBundle(); @Override UncommittedBundle<T> createBundle(PCollection<T> output); @Override UncommittedBundle<T> createKeyedBundle(
      StructuralKey<K> key, PCollection<T> output);  }
@Test public void rootBundleSucceeds() { UncommittedBundle<byte[]> root = factory.createRootBundle(); byte[] array = new byte[] {0, 1, 2}; root.add(WindowedValue.valueInGlobalWindow(array)); CommittedBundle<byte[]> committed = root.commit(Instant.now()); assertThat( committed.getElements(), containsInAnyOrder(WindowedValue.valueInGlobalWindow(array))); }