private boolean locationExists(TemplateLocationShortVoCollection templateLocations, LocSiteShortVo location) { if(templateLocations == null || location == null) return false; for(int x = 0; x < templateLocations.size(); x++) { TemplateLocationShortVo item = templateLocations.get(x); if(item != null && item.getLocationIsNotNull() && item.getLocation().equals(location)) return true; } return false; }