private void implicitRelease(
      Company company,
      LockType type,
      CDOTransaction tx,
      TestListener2 controlViewListener,
      boolean mustReceiveNotifications)
      throws CommitException {
    CDOViewLocksChangedEvent e;
    CDOObject cdoCompany = CDOUtil.getCDOObject(company);

    company.setName(company.getName() + "x"); // Make name field dirty
    cdoCompany.cdoWriteLock().lock();

    if (mustReceiveNotifications) {
      controlViewListener.waitFor(1);
      e = (CDOViewLocksChangedEvent) controlViewListener.getEvents().get(0);
      assertSame(Operation.LOCK, e.getOperation());
      assertSame(LockType.WRITE, e.getLockType());
    }

    tx.commit();

    if (mustReceiveNotifications) {
      controlViewListener.waitFor(2);
      e = (CDOViewLocksChangedEvent) controlViewListener.getEvents().get(1);
      assertSame(Operation.UNLOCK, e.getOperation());
      assertNull(e.getLockType());
    }

    if (!mustReceiveNotifications) {
      assertEquals(0, controlViewListener.getEvents().size());
    }
  }