public String toString() { return getSourceString() + " " + message; }
public int compare(Message a, Message b) { return a.getSourceString().compareTo(b.getSourceString()); } });
private static String createErrorMessage(Collection<Message> errorMessages) { Formatter fmt = new Formatter().format("Guice configuration errors:%n%n"); int index = 1; for (Message errorMessage : errorMessages) { fmt.format("%s) Error at %s:%n", index++, errorMessage.getSourceString()) .format(" %s%n%n", errorMessage.getMessage()); } return fmt.format("%s error[s]", errorMessages.size()).toString(); }