public void refer(OperationProgress other) {
    // ensure the integrity and avoid dead lock.
    List<OperationStep> steps;
    List<Long> startTimes;
    synchronized (other) {
      steps = other._steps;
      startTimes = other._startTimes;
    }
    synchronized (this) {
      ensureMutable();
      this._steps = steps;
      this._startTimes = startTimes;
      this._mutable = false;
    }
  }
@Test
  public void testRefer() {
    OperationProgress progress1 = new OperationProgress();
    progress1.addStep(new Pending());
    OperationProgress progress2 = new OperationProgress();
    progress2.addStep(new WaitingForClusterModel());

    assertThat(progress1.progress().get(0), instanceOf(Pending.class));
    progress1.refer(progress2);
    assertThat(progress1.progress().get(0), instanceOf(WaitingForClusterModel.class));
    assertEquals(progress1.progress(), progress2.progress());
  }