### Question:
SharedObjectPool { public T get(T input) { myReadLock.lock(); try { WeakReference<T> ref = myPool.get(input); T poolObject = ref == null ? null : ref.get(); if (poolObject != null) { return poolObject; } } finally { myReadLock.unlock(); } myWriteLock.lock(); try { WeakReference<T> ref = myPool.get(input); T poolObject = ref == null ? null : ref.get(); if (poolObject == null) { myPool.put(input, new WeakReference<>(input)); poolObject = input; } return poolObject; } finally { myWriteLock.unlock(); } }  T get(T input); void remove(T obj); void runProcedure(PoolObjectProcedure<T> procedure); int size(); @Override String toString();  }### Answer:
@Test @SuppressWarnings({ "PMD.IntegerInstantiation", "deprecation" }) public void testGet() { SharedObjectPool<Integer> pool = new SharedObjectPool<>(); Integer first = new Integer(1); Integer second = new Integer(1); Integer two = new Integer(2); Assert.assertNotSame(first, second); Assert.assertSame(first, pool.get(first)); Assert.assertSame(first, pool.get(second)); Assert.assertNotSame(second, pool.get(second)); Assert.assertSame(two, pool.get(two)); first = new Integer(1); System.gc(); Assert.assertSame(first, pool.get(first)); }