@Test public void testSize() { assertEquals(0, size()); Kryo kryo1 = pool.borrow(); assertEquals(0, size()); Kryo kryo2 = pool.borrow(); assertFalse(kryo1 == kryo2); pool.release(kryo1); assertEquals(1, size()); pool.release(kryo2); assertEquals(2, size()); }
@Test public void releaseShouldAddKryoToPool() { assertEquals(0, size()); Kryo kryo = pool.borrow(); pool.release(kryo); assertEquals(1, size()); }
@Test public void getShouldReturnAvailableInstance() { Kryo kryo = pool.borrow(); pool.release(kryo); assertTrue(kryo == pool.borrow()); }