private String mostConnClass() { String s = ""; int high = 0; Map<String, Integer> crudClassMap = new HashMap<String, Integer>(); for (UMLCRUD umlcrud : umlcrudlist) { String sCrud = umlcrud.getClassName(); int connections = 1; if (crudClassMap.containsKey(sCrud)) { connections = crudClassMap.get(sCrud); connections++; } crudClassMap.put(sCrud, connections); } if (crudClassMap != null) { for (Map.Entry<String, Integer> entry : crudClassMap.entrySet()) { String key = entry.getKey(); Integer newHigh = entry.getValue(); if (newHigh >= high) { if (newHigh > high) { high = newHigh; s = "" + key; } else { s = s + ", " + key; } } } } s = s + " (" + high + ")"; return s; }