I\'m going to use a SoftReference-based cache (a pretty simple thing by itself). However, I\'ve came across a problem when writing a test for it.
The objective of th
An improvement that will work for more than 2G max memory. It loops until an OutOfMemory error occurs.
@Test
public void shouldNotHoldReferencesToObject() {
final SoftReference reference = new SoftReference( ... );
// Sanity check
assertThat(reference.get(), not(equalTo(null)));
// Force an OoM
try {
final ArrayList