TransformHierarchy { public void popNode() { current.finishSpecifying(); unexpandedInputs.remove(current); current = current.getEnclosingNode(); checkState(current != null, "Can't pop the root node of a TransformHierarchy"); } TransformHierarchy(); Node pushNode(String name, PInput input, PTransform<?, ?> transform); @Internal Node pushFinalizedNode(
      String name,
      Map<TupleTag<?>, PValue> inputs,
      PTransform<?, ?> transform,
      Map<TupleTag<?>, PValue> outputs); @Internal Node addFinalizedPrimitiveNode(
      String name,
      Map<TupleTag<?>, PValue> inputs,
      PTransform<?, ?> transform,
      Map<TupleTag<?>, PValue> outputs); Node replaceNode(Node existing, PInput input, PTransform<?, ?> transform); void finishSpecifyingInput(); void setOutput(POutput output); void replaceOutputs(Map<PValue, ReplacementOutput> originalToReplacement); void popNode(); Set<PValue> visit(PipelineVisitor visitor); Node getCurrent();  }
@Test public void pushWithoutPushFails() { thrown.expect(IllegalStateException.class); hierarchy.popNode(); }