// Memorize the group
String currentGroup = "";
// Display the test list
for (int i = 0; i < tests.size(); i++) {
IntegrationTest test = tests.get(i);
String group = StringUtils.trimToEmpty(test.getGroup());
if ("".equals(group))
group = "DEFAULT";
if (!group.equals(currentGroup)) {
System.out.println("");
System.out.println(group);
System.out.println(" ID|Name");
currentGroup = group;
}
StringBuffer buf = new StringBuffer();
System.out.format("%5s", Integer.toString(i + 1));
buf.append("|");
buf.append(test.getName());
System.out.println(buf.toString());
}
System.out.println("");
}