// Path: src/main/java/com/pengyifan/commons/lang/StringUtils.java
// public final class StringUtils {
// 
//   // │
//   public static final String BAR    = bar(1);
//   // └
//   public static final String END    = bar(2);
//   // ├
//   public static final String MIDDLE = bar(3);
// 
//   private StringUtils() throws InstantiationException {
//     throw new InstantiationException("This class is not for instantiation");
//   }
// 
//   private static String bar(int i) {
//     try {
//       switch (i) {
//       case 1:
//         return new String(new byte[] { -30, -108, -126 }, "utf8");
//       case 2:
//         return new String(new byte[] { -30, -108, -108 }, "utf8");
//       case 3:
//         return new String(new byte[] { -30, -108, -100 }, "utf8");
//       }
//     } catch (UnsupportedEncodingException e) {
//       e.printStackTrace();
//     }
//     return null;
//   }
// 
// }


import com.google.common.base.Function;
import com.pengyifan.commons.lang.StringUtils;
import javax.annotation.Nullable;
package com.pengyifan.commons.collections.heap;



public final class FibonacciHeapPrettyFormatter<E> implements Function<FibonacciHeap<E>, String>{

  @Nullable
  @Override
  public String apply(@Nullable FibonacciHeap heap) {
    if (heap.minimum() == null) {
      return "";
    }
    StringBuilder sb = new StringBuilder();
    toStringPreOrder(heap.minimum(), sb);
    return sb.toString();
  }

  private <E> StringBuilder toStringPreOrder(FibonacciHeap.Entry<E> node,
      StringBuilder sb) {
    if (node != null) {
      for (FibonacciHeap.Entry<E> cur : node.nodelist()) {
        String s = "";
// Path: src/main/java/com/pengyifan/commons/lang/StringUtils.java
// public final class StringUtils {
// 
//   // │
//   public static final String BAR    = bar(1);
//   // └
//   public static final String END    = bar(2);
//   // ├
//   public static final String MIDDLE = bar(3);
// 
//   private StringUtils() throws InstantiationException {
//     throw new InstantiationException("This class is not for instantiation");
//   }
// 
//   private static String bar(int i) {
//     try {
//       switch (i) {
//       case 1:
//         return new String(new byte[] { -30, -108, -126 }, "utf8");
//       case 2:
//         return new String(new byte[] { -30, -108, -108 }, "utf8");
//       case 3:
//         return new String(new byte[] { -30, -108, -100 }, "utf8");
//       }
//     } catch (UnsupportedEncodingException e) {
//       e.printStackTrace();
//     }
//     return null;
//   }
// 
// }


// Path: src/main/java/com/pengyifan/commons/collections/heap/FibonacciHeapPrettyFormatter.java
import com.google.common.base.Function;
import com.pengyifan.commons.lang.StringUtils;
import javax.annotation.Nullable;

package com.pengyifan.commons.collections.heap;



public final class FibonacciHeapPrettyFormatter<E> implements Function<FibonacciHeap<E>, String>{

  @Nullable
  @Override
  public String apply(@Nullable FibonacciHeap heap) {
    if (heap.minimum() == null) {
      return "";
    }
    StringBuilder sb = new StringBuilder();
    toStringPreOrder(heap.minimum(), sb);
    return sb.toString();
  }

  private <E> StringBuilder toStringPreOrder(FibonacciHeap.Entry<E> node,
      StringBuilder sb) {
    if (node != null) {
      for (FibonacciHeap.Entry<E> cur : node.nodelist()) {
        String s = "";
        for (FibonacciHeap.Entry<E> p = cur.parent; p != null; p = p.parent) {