Browse souce code repository at: https://github.com/jjYBdx4IL/java-evaluation/blob/master/src/test/java/tests/java/lang/InstanceLifetimeTest.java
package tests.java.lang;

import static org.junit.Assert.*;

import org.junit.Ignore;
import org.junit.Test;

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

public class InstanceLifetimeTest {

    @SuppressWarnings("unused")
    @Ignore
    @Test
    public void testFinalizeCall() throws InterruptedException {
        CountDownLatch finalizeLatch = new CountDownLatch(1);
        try {
            InstanceLifetime t1 = new InstanceLifetime(finalizeLatch, false);
        } catch (Exception ex) {}
        while (!finalizeLatch.await(1, TimeUnit.MICROSECONDS)) {
            StringBuilder sb = new StringBuilder(102400);
        }
    }
    
    @SuppressWarnings("unused")
    @Ignore
    @Test
    public void testFinalizeCallAfterConstructorFailure() throws InterruptedException {
        CountDownLatch finalizeLatch = new CountDownLatch(1);
        try {
            InstanceLifetime t1 = new InstanceLifetime(finalizeLatch, true);
            fail();
        } catch (Exception ex) {}
        while (!finalizeLatch.await(1, TimeUnit.MICROSECONDS)) {
            StringBuilder sb = new StringBuilder(102400);
        }
    }
    
}
-------------------------------------------------------------------------------
Test set: tests.java.lang.InstanceLifetimeTest
-------------------------------------------------------------------------------
Tests run: 2, Failures: 0, Errors: 0, Skipped: 2, Time elapsed: 0 s - in tests.java.lang.InstanceLifetimeTest
testFinalizeCall skipped
testFinalizeCallAfterConstructorFailure skipped