Pre-delegation rule

Good night @Harikrishna_06

I updated the code, but two thing’s I dont understand I have miss match type class exception, due to on the argument’s I can pass String data, and my other doubt is why you set a List at the beginning? I mean could I use this function getCerfiers() instead entity , this is my code and my exception

    CertificationEntity ce = (CertificationEntity)entity;
  
    
	if(ce != null) {
		
		String currentIdentity = ce.getIdentity();
		duenoActual = context.getObjectByName(Identity.class,currentIdentity);
		customLog.warn("current  owner for certification is: "+ce.getName());
	}else if(ce == null) {
		customLog.warn("the ce variable is null");
	}
	
	if(duenoActual != null) {
    	List<Identity> userGroup = duenoActual.getWorkgroups();
    	if(userGroup !=null) {
    		for(Identity wg : userGroup) {
    			if(executiveWorkGroup.equals(wg.getName())) {
    				bandera = true;
    				break;
    			}
    		}
    	}
    	Identity baIdentity = context.getObjectByName(Identity.class,baWorkGroup);
    	if(bandera && baIdentity != null) {
    		customLog.warn("El certificador "+duenoActual.getName()+
    				"es miembro de "+executiveWorkGroup+"delegado a: "+baWorkGroup);
    		resultado.put("recipientName",baIdentity);
    		resultado.put("reassign",Boolean.TRUE);
    	} else {
    		customLog.warn("El cerificador "+duenoActual.getName()+
    				" no pertenece al workgroup: "+executiveWorkGroup);
    	}
    }else {
    	customLog.warn("Owner is not a identity "+ duenoActual.getClass().getName());
    }
    
    

    return resultado;

Im running out of ideas :exploding_head: