1 package com.lexicalscope.jewel;
2
3 import java.util.Arrays;
4 import java.util.List;
5
6
7
8
9
10
11 public class UtilitiesForTesting
12 {
13 private final static String lineSeparator = System.getProperty("line.separator");
14
15
16
17
18
19
20
21
22 public static String joinLines(final String... lines)
23 {
24 final StringBuilder result = new StringBuilder();
25
26 String separator = "";
27 for (final String line : lines)
28 {
29 result.append(separator).append(line);
30 separator = lineSeparator;
31 }
32 return result.toString();
33 }
34
35 public static List<String> splitLines(final String helpMessage)
36 {
37 return Arrays.asList(helpMessage.split(lineSeparator));
38 }
39 }