TypedPoolableObjectFactory<MockObjectWithArgs> factory = TypedPoolableObjectFactory.makeFactory(MockObjectWithArgs.class, true, expected0, expected1);
assertNotNull(factory);
StackObjectPool pool = new StackObjectPool(factory);
MockObjectWithArgs obj = (MockObjectWithArgs)pool.borrowObject();
assertNotNull(obj);
assertTrue(obj.isInitialized());
assertEquals(expected0, obj.value0);
assertEquals(expected1, obj.value1);
}