@Test
    public void test_isSwitchOn() {
        for (int i = 0; i < 7; ++i) {
            Assert.assertTrue(ProtocolSwitch.isOn(i, (1 << i)));
        }
        Assert.assertTrue(ProtocolSwitch.isOn(0, 1));
        Assert.assertTrue(ProtocolSwitch.isOn(1, 2));
        Assert.assertTrue(ProtocolSwitch.isOn(2, 4));
        Assert.assertTrue(ProtocolSwitch.isOn(3, 8));
        Assert.assertTrue(ProtocolSwitch.isOn(0, 3));
        Assert.assertTrue(ProtocolSwitch.isOn(1, 3));
        Assert.assertFalse(ProtocolSwitch.isOn(2, 3));
        Assert.assertTrue(ProtocolSwitch.isOn(6, 64));
        Assert.assertFalse(ProtocolSwitch.isOn(0, 64));
        Assert.assertTrue(ProtocolSwitch.isOn(0, 127));
        Assert.assertTrue(ProtocolSwitch.isOn(1, 127));
        Assert.assertFalse(ProtocolSwitch.isOn(7, 127));
        try {
            ProtocolSwitch.isOn(7, 255);
            Assert.fail("Should not reach here!");
        } catch (IllegalArgumentException e) {
        }
    }
@author tsui
@version $Id: ProtocolSwitchStatusTest.java, v 0.1 2017-10-09 20:23 tsui Exp $
src/test/java/com/alipay/remoting/inner/utiltest/ProtocolSwitchTest.java