private boolean roleExists(TemplateRoleShortVoCollection roles, AppRoleShortVo appRoleVo) { if(roles == null || appRoleVo == null) return false; for(int i = 0; i < roles.size(); i++) { TemplateRoleShortVo voTemplateRoleShort = roles.get(i); if(voTemplateRoleShort != null && voTemplateRoleShort.getAppRoleIsNotNull() && voTemplateRoleShort.getAppRole().equals(appRoleVo)) return true; } return false; }