public void dropBackend(Backend backend) {
        idToBackendRef.remove(backend.getId());

        Map<Long, AtomicLong> copiedReportVersions = Maps.newHashMap(idToReportVersionRef);
        copiedReportVersions.remove(backend.getId());
        idToReportVersionRef = ImmutableMap.copyOf(copiedReportVersions);
    }
@Test
    public void testDropBackend() throws Exception {
        new MockUp<RunMode>() {
            @Mock
            public RunMode getCurrentRunMode() {
                return RunMode.SHARED_DATA;
            }
        };

        Backend be = new Backend(10001, "newHost", 1000);
        service.addBackend(be);

        LocalMetastore localMetastore = new LocalMetastore(globalStateMgr, null, null);

        new Expectations() {
            {
                service.getBackendWithHeartbeatPort("newHost", 1000);
                minTimes = 0;
                result = be;

                globalStateMgr.getLocalMetastore();
                minTimes = 0;
                result = localMetastore;
            }
        };

        service.addBackend(be);
        be.setStarletPort(1001);
        service.dropBackend("newHost", 1000, false);
        Backend beIP = service.getBackendWithHeartbeatPort("newHost", 1000);
        Assert.assertTrue(beIP == null);
    }