public void testInducedFinalization() throws Exception {
  AtomicBoolean finalized1=new AtomicBoolean();
  AtomicBoolean finalized2=new AtomicBoolean();
  createFinalizableObject(finalized1);
  createFinalizableObject(finalized2);
  FinalizationTester.induceFinalization();
  if (!finalized1.get() || !finalized2.get()) {
    fail("not yet finalized: " + finalized1.get() + " "+ finalized2.get());
  }
}

public void testInducedFinalization ( ) throws Exception { AtomicBoolean finalized1 = new AtomicBoolean ( ) ; AtomicBoolean finalized2 = new AtomicBoolean ( ) ; createFinalizableObject ( finalized1 ) ; createFinalizableObject ( finalized2 ) ; FinalizationTester . induceFinalization ( ) ; if ( ! finalized1 . get ( ) || ! finalized2 . get ( ) ) { fail ( "not yet finalized: " + finalized1 . get ( ) + " " + finalized2 . get ( ) ) ; } }
test verifies that runfinalization ( ) does not mess up objects that should be finalized later on . http : / / b / 6907299
