public boolean checkFeExistByRPCPort(String host, int rpcPort) {
        try {
            tryLock(true);
            return frontends
                    .values()
                    .stream()
                    .anyMatch(fe -> fe.getHost().equals(host) && fe.getRpcPort() == rpcPort);
        } finally {
            unlock();
        }
    }
@Test
    public void testCheckFeExistByRpcPort() {
        NodeMgr nodeMgr = new NodeMgr();
        Frontend fe = new Frontend(FrontendNodeType.FOLLOWER, "node1", "10.0.0.3", 9010);
        fe.handleHbResponse(new FrontendHbResponse("node1", 9030, 9020, 1,
                System.currentTimeMillis(), System.currentTimeMillis(), "v1"), true);
        nodeMgr.replayAddFrontend(fe);

        Assert.assertTrue(nodeMgr.checkFeExistByRPCPort("10.0.0.3", 9020));
        Assert.assertFalse(nodeMgr.checkFeExistByRPCPort("10.0.0.3", 9030));
        Assert.assertFalse(nodeMgr.checkFeExistByRPCPort("10.0.0.2", 9020));
    }