ValueExpression valueExpression = application.getExpressionFactory().createValueExpression(facesContext.getELContext(),"#{cloneableBean}", CloneableBean.class);
validator.setValueExpression("value", valueExpression);
CloneableBean bean = new CloneableBean();
facesContext.getExternalContext().getSessionMap().put("cloneableBean", bean);
validator.processDecodes(facesContext);
GraphValidatorState validatorState = validator.getValidatorState(facesContext);
assertNotNull(validatorState);
assertNotSame(bean, validatorState.getCloned());
validator.processValidators(facesContext);
assertTrue(facesContext.getRenderResponse());
assertTrue(facesContext.getMessages().hasNext());
}