AbstractSnatService implements SnatServiceListener { static int mostSignificantBit(int value) { return 31 - Integer.numberOfLeadingZeros(value); } AbstractSnatService(final DataBroker dataBroker, final IMdsalApiManager mdsalManager,
        final ItmRpcService itmManager, final OdlInterfaceRpcService odlInterfaceRpcService,
        final IdManagerService idManager, final NAPTSwitchSelector naptSwitchSelector,
        final IInterfaceManager interfaceManager,
        final IVpnFootprintService vpnFootprintService,
        final IFibManager fibManager, final NatDataUtil natDataUtil,
        final DataTreeEventCallbackRegistrar eventCallbacks); @Override boolean addSnatAllSwitch(TypedReadWriteTransaction<Configuration> confTx, Routers routers,
        Uint64 primarySwitchId); @Override boolean removeSnatAllSwitch(TypedReadWriteTransaction<Configuration> confTx, Routers routers,
            Uint64 primarySwitchId); @Override boolean addSnat(TypedReadWriteTransaction<Configuration> confTx, Routers routers, Uint64 primarySwitchId,
                           Uint64 dpnId); @Override boolean removeSnat(TypedReadWriteTransaction<Configuration> confTx, Routers routers,
            Uint64 primarySwitchId, Uint64 dpnId); @Override boolean addCentralizedRouterAllSwitch(TypedReadWriteTransaction<Configuration> confTx, Routers routers,
            Uint64 primarySwitchId); @Override boolean removeCentralizedRouterAllSwitch(TypedReadWriteTransaction<Configuration> confTx, Routers routers,
            Uint64 primarySwitchId); @Override boolean addCentralizedRouter(TypedReadWriteTransaction<Configuration> confTx, Routers routers,
            Uint64 primarySwitchId, Uint64 dpnId); @Override boolean removeCentralizedRouter(TypedReadWriteTransaction<Configuration> confTx, Routers routers,
            Uint64 primarySwitchId, Uint64 dpnId); @Override boolean handleRouterUpdate(TypedReadWriteTransaction<Configuration> confTx,
            Routers origRouter, Routers updatedRouter);  }
@Test public void testMostSignificantBit() { Assert.assertEquals(-1, AbstractSnatService.mostSignificantBit(0)); for (int bit = 0; bit < 31; bit++) { for (int test = 1 << bit; test < 1 << (bit + 1); test++) { Assert.assertEquals(bit, AbstractSnatService.mostSignificantBit(test)); } } }