package eu.eudat.utilities.helpers; import java.util.List; public class LabelBuilder { private static String generateLabel(List items){ String label=""; for(T item : items){ if(items.indexOf(item)==3){ label+="..."; break; } if(items.indexOf(item)>1){ label+=", "; } label+=item.generateLabel(); } return label; } public static String getLabel(List items){ return generateLabel(items); } }