@Override
    public void updateNode(K8sNode node) {
        checkNotNull(node, ERR_NULL_NODE);

        K8sNode intNode;
        K8sNode extNode;
        K8sNode localNode;
        K8sNode tunNode;

        K8sNode existingNode = nodeStore.node(node.hostname());
        checkNotNull(existingNode, ERR_NULL_NODE);

        DeviceId existIntgBridge = nodeStore.node(node.hostname()).intgBridge();

        if (node.intgBridge() == null) {
            intNode = node.updateIntgBridge(existIntgBridge);
            checkArgument(!hasIntgBridge(intNode.intgBridge(), intNode.hostname()),
                    NOT_DUPLICATED_MSG, intNode.intgBridge());
        } else {
            intNode = node;
            checkArgument(!hasIntgBridge(intNode.intgBridge(), intNode.hostname()),
                    NOT_DUPLICATED_MSG, intNode.intgBridge());
        }

        DeviceId existExtBridge = nodeStore.node(node.hostname()).extBridge();

        if (intNode.extBridge() == null) {
            extNode = intNode.updateExtBridge(existExtBridge);
            checkArgument(!hasExtBridge(extNode.extBridge(), extNode.hostname()),
                    NOT_DUPLICATED_MSG, extNode.extBridge());
        } else {
            extNode = intNode;
            checkArgument(!hasExtBridge(extNode.extBridge(), extNode.hostname()),
                    NOT_DUPLICATED_MSG, extNode.extBridge());
        }

        DeviceId existLocalBridge = nodeStore.node(node.hostname()).localBridge();

        if (extNode.localBridge() == null) {
            localNode = extNode.updateLocalBridge(existLocalBridge);
            checkArgument(!hasLocalBridge(localNode.localBridge(), localNode.hostname()),
                    NOT_DUPLICATED_MSG, localNode.localBridge());
        } else {
            localNode = extNode;
            checkArgument(!hasLocalBridge(localNode.localBridge(), localNode.hostname()),
                    NOT_DUPLICATED_MSG, localNode.localBridge());
        }

        if (node.mode() == NORMAL) {
            DeviceId existTunBridge = nodeStore.node(node.hostname()).tunBridge();

            if (localNode.tunBridge() == null) {
                tunNode = localNode.updateTunBridge(existTunBridge);
                checkArgument(!hasTunBridge(tunNode.tunBridge(), tunNode.hostname()),
                        NOT_DUPLICATED_MSG, tunNode.tunBridge());
            } else {
                tunNode = localNode;
                checkArgument(!hasTunBridge(tunNode.tunBridge(), tunNode.hostname()),
                        NOT_DUPLICATED_MSG, tunNode.tunBridge());
            }
            nodeStore.updateNode(tunNode);
        } else {
            nodeStore.updateNode(localNode);
        }
        log.info(String.format(MSG_NODE, extNode.hostname(), MSG_UPDATED));
    }
@Test(expected = NullPointerException.class)
    public void testUpdateNullNode() {
        target.updateNode(null);
    }