private void startlistening(CoordinatorImp coordinator){
  Set<TxState> forgetStates=new HashSet<TxState>();
  for (  TxState txState : TxState.values()) {
    if (txState.isFinalStateForOltp()) {
      forgetStates.add(txState);
    }
  }
  for (  TxState txState : forgetStates) {
    coordinator.addFSMEnterListener(this,txState);
  }
  if (forgetStates.contains(coordinator.getState()))   removeCoordinator(coordinator);
}

private void startlistening ( CoordinatorImp coordinator ) { Set < TxState > forgetStates = new HashSet < TxState > ( ) ; for ( TxState txState : TxState . values ( ) ) { if ( txState . isFinalStateForOltp ( ) ) { forgetStates . add ( txState ) ; } } for ( TxState txState : forgetStates ) { coordinator . addFSMEnterListener ( this , txState ) ; } if ( forgetStates . contains ( coordinator . getState ( ) ) ) removeCoordinator ( coordinator ) ; }
start listening for terminated states , so coordinator can be removed .
