Ejemplo n.º 1
0
  public static void main(String[] args) {
    Value v1 = new Value();
    Value v2 = new Value();
    v1.i = v2.i = 100;
    System.out.println(v1.equals(v2));

    monitor.expect(new String[] {"false"});
  }
Ejemplo n.º 2
0
  public static void main(String[] args) {
    Book novel = new Book(true);
    // Proper cleanup:
    novel.checkIn();
    // Drop the reference, forget to clean up:
    new Book(true);
    // Force garbage collection & finalization:
    System.gc();

    monitor.expect(new String[] {"Error: checked out"}, Test.WAIT);
  }