private void changeReplicas(PrimaryTerm term) {
    threadContext.execute(() -> {
      if (this.term == null || term.term() > this.term.term()) {
        this.term = term;
        consumer.register(term.primary().memberId());
      }
    });
  }
private void changeReplicas ( PrimaryTerm term ) { threadContext . execute ( ( ) -> { if ( this . term == null || term . term ( ) > this . term . term ( ) ) { this . term = term ; consumer . register ( term . primary ( ) . memberId ( ) ) ; } } ) ; }
Handles a replica change event.