factory.setValidateSelectively(true); // Even numbers fail validation
factory.setPassivateSelectively(true); // Multiples of 3 fail passivation
for(int i=0;i<10;i++) {
pool.returnObject(obj[i]);
assertEquals("Each time we return, get one less active.", 9-i, pool.getNumActive());
}
// 0,2,4,6,8 fail validation, 3, 9 fail passivation - 3 left.
assertEquals(3,pool.getNumIdle());
}