StringBuilder stringBuilder = new StringBuilder()
.append("Could not add a default container to registry because multiple instances of ")
.append(DeployableContainer.class.getName())
.append(" found on classpath (candidates are: ");
String separator = "";
for (DeployableContainer s : serviceLoader.all(DeployableContainer.class)) {
stringBuilder.append(separator)
.append(s.getConfigurationClass().getName());
separator = ", ";
}
stringBuilder.append(")");