@Test public void toStringShouldNotIncludeParent() throws Exception { SortingNode<Integer> tree = new SortingNode.Builder<Integer>() .childNode(200).siblingNode(210).siblingNode(220).build(); assertNotNull("include parent in toString will go infinite loop", tree.toString()); }
@Override public String toString() { return "SortingNode{" + "value=" + value + ", children=" + children + '}'; }
SortingNode { @Override public String toString() { return "SortingNode{" + "value=" + value + ", children=" + children + '}'; } }
SortingNode { @Override public String toString() { return "SortingNode{" + "value=" + value + ", children=" + children + '}'; } private  SortingNode(@Nullable T value,
      @Nullable SortingNode<T> parent,
      Stream<UnaryOperator<SortingNode<T>>> childrenFactory); private  SortingNode(@Nullable T value,
      @Nullable SortingNode<T> parent,
      ImmutableList<SortingNode<T>> children); }
SortingNode { @Override public String toString() { return "SortingNode{" + "value=" + value + ", children=" + children + '}'; } private  SortingNode(@Nullable T value,
      @Nullable SortingNode<T> parent,
      Stream<UnaryOperator<SortingNode<T>>> childrenFactory); private  SortingNode(@Nullable T value,
      @Nullable SortingNode<T> parent,
      ImmutableList<SortingNode<T>> children); @SuppressWarnings("unchecked") static SortingNode<T> emptyRoot(); @Override String toString(); @Nullable T getValue(); @Nullable SortingNode<T> getParent(); boolean hasParent(); boolean isRoot(); List<SortingNode<T>> getChildren(); boolean hasChild(); SortingNode<T> deepSort(Comparator<SortingNode<T>> comparator); String prettyPrint(); Stream<T> depthFirst(); Stream<T> breathFirst(); }
SortingNode { @Override public String toString() { return "SortingNode{" + "value=" + value + ", children=" + children + '}'; } private  SortingNode(@Nullable T value,
      @Nullable SortingNode<T> parent,
      Stream<UnaryOperator<SortingNode<T>>> childrenFactory); private  SortingNode(@Nullable T value,
      @Nullable SortingNode<T> parent,
      ImmutableList<SortingNode<T>> children); @SuppressWarnings("unchecked") static SortingNode<T> emptyRoot(); @Override String toString(); @Nullable T getValue(); @Nullable SortingNode<T> getParent(); boolean hasParent(); boolean isRoot(); List<SortingNode<T>> getChildren(); boolean hasChild(); SortingNode<T> deepSort(Comparator<SortingNode<T>> comparator); String prettyPrint(); Stream<T> depthFirst(); Stream<T> breathFirst();  }