PrettyDisplayUtils { public static String prependStringWithIndent(String text, String s) { int lens = s.length(); String indentedText = indentLines(text, lens); return s + indentedText.substring(lens); }  static String display(T v); static String display(T v, boolean useRawDoubleFormat); static String displayDouble(double v, String format); static String displayDouble(double v, String format, boolean useRawDoubleFormat); static String displayDouble(double v); static String displayDouble(double v, boolean useRawDoubleFormat); static String displayList(List<T> list, int numEdgeItems, boolean linebreak); static String displayList(List<T> list, boolean linebreak); static String displayList(List<T> list); static String displayDenseVector(DenseVector dv); static String displayDenseMatrix(DenseMatrix dm); static String displayMap(Map<?, ?> m, int numEdgeItems, boolean linebreak); static String displayMap(Map<?, ?> m); static String displayTable(T[][] table, int nRows, int nCols,
                                          String[] rowNames, String[] colNames, String cornerName,
                                          int nRowEdgeItems, int nColEdgeItems); static String displayTable(T[][] table, int nRows, int nCols,
                                          String[] rowNames, String[] colNames, String cornerName,
                                          int nRowEdgeItems, int nColEdgeItems,
                                          boolean useRawDoubleFormat); static String displayTable(T[][] table, int nRows, int nCols,
                                          String[] rowNames, String[] colNames, String cornerName); static String indentLines(String text, int indentSize); static String prependStringWithIndent(String text, String s); static String displayHeadline(String head, Character padChar);  }
@Test public void prependStringWithIndent() { List<DenseVector> denseVectors = new ArrayList<>(); for (int i = 0; i < 10; i += 1) { denseVectors.add(new DenseVector(generateRandomDoubleArray(10))); } String content = displayList(denseVectors, true); content = PrettyDisplayUtils.prependStringWithIndent(content, "centers: "); System.out.println(content); }