SdkComponents { public String registerPCollection(PCollection<?> pCollection) throws IOException { String existing = pCollectionIds.get(pCollection); if (existing != null) { return existing; } String uniqueName = uniqify(pCollection.getName(), pCollectionIds.values()); pCollectionIds.put(pCollection, uniqueName); componentsBuilder.putPcollections( uniqueName, PCollectionTranslation.toProto(pCollection, this)); return uniqueName; } private  SdkComponents(
      @Nullable Components components,
      @Nullable Collection<String> requirements,
      String newIdPrefix); static SdkComponents create(); static SdkComponents create(
      RunnerApi.Components components, Collection<String> requirements); static SdkComponents create(PipelineOptions options); void mergeFrom(
      RunnerApi.Components components, @Nullable Collection<String> requirements); SdkComponents withNewIdPrefix(String newIdPrefix); String registerPTransform(
      AppliedPTransform<?, ?, ?> appliedPTransform, List<AppliedPTransform<?, ?, ?>> children); String getPTransformIdOrThrow(AppliedPTransform<?, ?, ?> appliedPTransform); String registerPCollection(PCollection<?> pCollection); String registerWindowingStrategy(WindowingStrategy<?, ?> windowingStrategy); String registerCoder(Coder<?> coder); String registerEnvironment(Environment env); String getOnlyEnvironmentId(); void addRequirement(String urn); RunnerApi.Components toComponents(); Collection<String> requirements();  }
@Test public void registerPCollection() throws IOException { PCollection<Long> pCollection = pipeline.apply(GenerateSequence.from(0)).setName("foo"); String id = components.registerPCollection(pCollection); assertThat(id, equalTo("foo")); components.toComponents().getPcollectionsOrThrow(id); }