// check for duplicate before adding the new link private boolean duplicateCheck(String label) { for (CustomlinksResourceModel.Link link : customlinks) if (link.getLabel().equals(label)) return true; return false; }