MockControl pbControl = MockControl.createControl(PersistenceBroker.class);
final PersistenceBroker pb = (PersistenceBroker) pbControl.getMock();
MockControl idfControl = MockControl.createControl(IdentityFactory.class);
final IdentityFactory idf = (IdentityFactory) idfControl.getMock();
Identity identity = new Identity(String.class, Object.class, new Object[] {"id"});
pb.serviceIdentity();
pbControl.setReturnValue(idf, 1);
idf.buildIdentity(String.class, "id");
idfControl.setReturnValue(identity, 1);
pb.getObjectByIdentity(identity);