### Question:
OvsdbHelper { public static Node getNodeFromBridgeRef(OvsdbBridgeRef bridgeRef, DataBroker dataBroker) { InstanceIdentifier<Node> nodeIid = bridgeRef.getValue().firstIdentifierOf(Node.class); ReadTransaction transaction = dataBroker.newReadOnlyTransaction(); Optional<?> node = readFromDs(LogicalDatastoreType.OPERATIONAL, nodeIid, transaction); if (node.isPresent()) { if (node.get() instanceof Node) { return (Node) node.get(); } } return null; }  static OvsdbBridgeAugmentation getOvsdbBridgeFromTerminationPoint(
            InstanceIdentifier<OvsdbTerminationPointAugmentation> tpIid, DataBroker dataBroker); static Node getNodeFromBridgeRef(OvsdbBridgeRef bridgeRef, DataBroker dataBroker); static OvsdbTerminationPointAugmentation getOvsdbTerminationPoint(
            InstanceIdentifier<OvsdbTerminationPointAugmentation> tpIid, DataBroker dataBroker); static Node getNode(Node node, List<TerminationPoint> tps,
            OvsdbBridgeAugmentation ovsdbBridgeAugmentation); static OvsdbBridgeAugmentation buildOvsdbBridgeAugmentation(OvsdbBridgeAugmentation bridge,
            OvsdbNodeAugmentation ovsdbNode); static List<TerminationPoint> buildTerminationPoints(OvsdbBridgeAugmentation bridge,
            OvsdbTerminationPointAugmentation ovsdbTp, AbstractTunnelType tunnelType); static String generateTpName(OvsdbBridgeAugmentation bridge, AbstractTunnelType tunnelType); static OvsdbTerminationPointAugmentation buildOvsdbTerminationPointAugmentation(
            OvsdbBridgeAugmentation bridge, List<Options> options, AbstractTunnelType tunnelType); static void setOption(List<Options> options, String key, String value); static IpAddress getManagerIp(OvsdbNodeAugmentation ovsdbNode); static IpAddress getNodeIp(OvsdbNodeAugmentation ovsdbNode); static List<ControllerEntry> buildControllerEntries(IpAddress ip); static OvsdbNodeAugmentation getManagerNode(OvsdbBridgeAugmentation bridge, DataBroker dataBroker); static Node getTopologyNode(InstanceIdentifier<Node> nodeIid, DataBroker dataBroker); static void createTunnelPort(InstanceIdentifier<Node> nodeIid,
            Node node, AbstractTunnelType tunnelType, DataBroker dataBroker);  }### Answer:
@SuppressWarnings({"unchecked", "rawtypes"}) @Test public void testGetNodeFromBridgeRef() { OvsdbBridgeRef bridgeRef = mock(OvsdbBridgeRef.class); when(bridgeRef.getValue()).thenReturn((InstanceIdentifier) tpIid); when(readTransaction.read(any(LogicalDatastoreType.class), any(InstanceIdentifier.class))) .thenReturn(nodeFuture); assertNotNull(OvsdbHelper.getNodeFromBridgeRef(bridgeRef, dataBroker)); verify(readTransaction).read(any(LogicalDatastoreType.class), any(InstanceIdentifier.class)); }
@SuppressWarnings({"unchecked", "rawtypes"}) @Test public void testGetNodeFromBridgeRef_PresentFalse() { OvsdbBridgeRef bridgeRef = mock(OvsdbBridgeRef.class); when(bridgeRef.getValue()).thenReturn((InstanceIdentifier) tpIid); when(readTransaction.read(any(LogicalDatastoreType.class), any(InstanceIdentifier.class))) .thenReturn(nodeFuture); when(nodeOptional.isPresent()).thenReturn(false); assertNull(OvsdbHelper.getNodeFromBridgeRef(bridgeRef, dataBroker)); verify(readTransaction).read(any(LogicalDatastoreType.class), any(InstanceIdentifier.class)); }