MockControl extractorControl = newControl(RequestLocaleManager.class);
RequestLocaleManager extractor = (RequestLocaleManager) extractorControl.getMock();
MockControl poolControl = newControl(ObjectPool.class);
ObjectPool pool = (ObjectPool) poolControl.getMock();
// Training
extractor.extractLocaleForCurrentRequest();
extractorControl.setReturnValue(Locale.CHINESE);
IEngine engine = (IEngine) newMock(IEngine.class);
pool.get(Locale.CHINESE);
poolControl.setReturnValue(null);
MockControl factoryControl = newControl(EngineFactory.class);
EngineFactory factory = (EngineFactory) factoryControl.getMock();