@Test(expected = IllegalStateException.class) public void testMultipleRecycle() { RecyclableObject object = RecyclableObject.newInstance(); object.recycle(); object.recycle(); }
public final boolean recycle(T o, Handle handle) { DefaultHandle h = (DefaultHandle) handle; if (h.stack.parent != this) { return false; } if (o != h.value) { throw new IllegalArgumentException("o does not belong to handle"); } h.recycle(); return true; }
Recycler { public final boolean recycle(T o, Handle handle) { DefaultHandle h = (DefaultHandle) handle; if (h.stack.parent != this) { return false; } if (o != h.value) { throw new IllegalArgumentException("o does not belong to handle"); } h.recycle(); return true; } }
Recycler { public final boolean recycle(T o, Handle handle) { DefaultHandle h = (DefaultHandle) handle; if (h.stack.parent != this) { return false; } if (o != h.value) { throw new IllegalArgumentException("o does not belong to handle"); } h.recycle(); return true; } protected  Recycler(); protected  Recycler(int maxCapacity); }
Recycler { public final boolean recycle(T o, Handle handle) { DefaultHandle h = (DefaultHandle) handle; if (h.stack.parent != this) { return false; } if (o != h.value) { throw new IllegalArgumentException("o does not belong to handle"); } h.recycle(); return true; } protected  Recycler(); protected  Recycler(int maxCapacity); @SuppressWarnings("unchecked") final T get(); final boolean recycle(T o, Handle handle); }
Recycler { public final boolean recycle(T o, Handle handle) { DefaultHandle h = (DefaultHandle) handle; if (h.stack.parent != this) { return false; } if (o != h.value) { throw new IllegalArgumentException("o does not belong to handle"); } h.recycle(); return true; } protected  Recycler(); protected  Recycler(int maxCapacity); @SuppressWarnings("unchecked") final T get(); final boolean recycle(T o, Handle handle);  }