static Node selectReferenceNode(FlowRule rule, Context context, DefaultNode node) {
        String refResource = rule.getRefResource();
        int strategy = rule.getStrategy();

        if (StringUtil.isEmpty(refResource)) {
            return null;
        }

        if (strategy == RuleConstant.STRATEGY_RELATE) {
            return ClusterBuilderSlot.getClusterNode(refResource);
        }

        if (strategy == RuleConstant.STRATEGY_CHAIN) {
            if (!refResource.equals(context.getName())) {
                return null;
            }
            return node;
        }
        // No node.
        return null;
    }
@Test
    public void testSelectReferenceNodeForContextEntrance() {
        String contextName = "good_context";

        DefaultNode node = mock(DefaultNode.class);
        Context context = mock(Context.class);

        FlowRule rule = new FlowRule("testSelectReferenceNodeForContextEntrance")
            .setCount(1)
            .setStrategy(RuleConstant.STRATEGY_CHAIN)
            .setRefResource(contextName);

        when(context.getName()).thenReturn(contextName);
        assertEquals(node, FlowRuleChecker.selectReferenceNode(rule, context, node));

        when(context.getName()).thenReturn("other_context");
        assertNull(FlowRuleChecker.selectReferenceNode(rule, context, node));
    }