@Override
    public NodeOptions copy() {
        final NodeOptions nodeOptions = new NodeOptions();
        nodeOptions.setElectionTimeoutMs(this.electionTimeoutMs);
        nodeOptions.setElectionPriority(this.electionPriority);
        nodeOptions.setDecayPriorityGap(this.decayPriorityGap);
        nodeOptions.setSnapshotIntervalSecs(this.snapshotIntervalSecs);
        nodeOptions.setSnapshotLogIndexMargin(this.snapshotLogIndexMargin);
        nodeOptions.setCatchupMargin(this.catchupMargin);
        nodeOptions.setFilterBeforeCopyRemote(this.filterBeforeCopyRemote);
        nodeOptions.setDisableCli(this.disableCli);
        nodeOptions.setSharedTimerPool(this.sharedTimerPool);
        nodeOptions.setTimerPoolSize(this.timerPoolSize);
        nodeOptions.setCliRpcThreadPoolSize(this.cliRpcThreadPoolSize);
        nodeOptions.setRaftRpcThreadPoolSize(this.raftRpcThreadPoolSize);
        nodeOptions.setEnableMetrics(this.enableMetrics);
        nodeOptions.setRaftOptions(this.raftOptions == null ? new RaftOptions() : this.raftOptions.copy());
        nodeOptions.setSharedElectionTimer(this.sharedElectionTimer);
        nodeOptions.setSharedVoteTimer(this.sharedVoteTimer);
        nodeOptions.setSharedStepDownTimer(this.sharedStepDownTimer);
        nodeOptions.setSharedSnapshotTimer(this.sharedSnapshotTimer);

        nodeOptions.setRpcConnectTimeoutMs(super.getRpcConnectTimeoutMs());
        nodeOptions.setRpcDefaultTimeout(super.getRpcDefaultTimeout());
        nodeOptions.setRpcInstallSnapshotTimeout(super.getRpcInstallSnapshotTimeout());
        nodeOptions.setRpcProcessorThreadPoolSize(super.getRpcProcessorThreadPoolSize());
        nodeOptions.setEnableRpcChecksum(super.isEnableRpcChecksum());
        nodeOptions.setMetricRegistry(super.getMetricRegistry());

        return nodeOptions;
    }
@Test
    public void testCopyRpcOptionsRight() {
        final NodeOptions nodeOptions = new NodeOptions();

        assertEquals(1000, nodeOptions.getRpcConnectTimeoutMs());
        assertEquals(5000, nodeOptions.getRpcDefaultTimeout());
        assertEquals(5 * 60 * 1000, nodeOptions.getRpcInstallSnapshotTimeout());
        assertEquals(80, nodeOptions.getRpcProcessorThreadPoolSize());
        assertFalse(nodeOptions.isEnableRpcChecksum());
        assertNull(nodeOptions.getMetricRegistry());

        //change options
        nodeOptions.setRpcConnectTimeoutMs(2000);
        nodeOptions.setRpcDefaultTimeout(6000);
        nodeOptions.setRpcInstallSnapshotTimeout(6 * 60 * 1000);
        nodeOptions.setRpcProcessorThreadPoolSize(90);
        nodeOptions.setEnableRpcChecksum(true);
        nodeOptions.setMetricRegistry(new MetricRegistry());

        //copy options
        final NodeOptions copy = nodeOptions.copy();

        assertEquals(2000, copy.getRpcConnectTimeoutMs());
        assertEquals(6000, copy.getRpcDefaultTimeout());
        assertEquals(6 * 60 * 1000, copy.getRpcInstallSnapshotTimeout());
        assertEquals(90, copy.getRpcProcessorThreadPoolSize());
        assertTrue(copy.isEnableRpcChecksum());
        assertNotNull(copy.getMetricRegistry());
    }