public ComputeNode getBackendOrComputeNode(long nodeId) {
        ComputeNode backend = idToBackendRef.get(nodeId);
        if (backend == null) {
            backend = idToComputeNodeRef.get(nodeId);
        }
        return backend;
    }
@Test
    public void testGetBackendOrComputeNode() {
        mockNet();

        Backend be = new Backend(10001, "host1", 1000);
        service.addBackend(be);
        ComputeNode cn = new ComputeNode(10002, "host2", 1000);
        cn.setBePort(1001);
        service.addComputeNode(cn);

        Assert.assertEquals(be, service.getBackendOrComputeNode(be.getId()));
        Assert.assertEquals(cn, service.getBackendOrComputeNode(cn.getId()));
        Assert.assertNull(service.getBackendOrComputeNode(/* Not Exist */ 100));

        Assert.assertEquals(cn, service.getBackendOrComputeNodeWithBePort("host2", 1001));
        Assert.assertFalse(service.checkNodeAvailable(cn));
        Assert.assertFalse(service.checkNodeAvailable(be));

        List<ComputeNode> nodes = service.backendAndComputeNodeStream().collect(Collectors.toList());
        Assert.assertEquals(2, nodes.size());
        Assert.assertEquals(be, nodes.get(0));
        Assert.assertEquals(cn, nodes.get(1));
    }