@Test
public void setShuttingDown() throws Exception {

    boolean old = RpcRunningState.isShuttingDown();
    try {
        RpcRunningState.setShuttingDown(true);
        Assert.assertTrue(RpcRunningState.isShuttingDown());
        RpcRunningState.setShuttingDown(false);
        Assert.assertFalse(RpcRunningState.isShuttingDown());
    } finally {
        RpcRunningState.setShuttingDown(old);
    }
}