### Question:
OvsdbControllerUpdateCommand extends AbstractTransactionCommand { private Map<InstanceIdentifier<Node>, Node> getBridgeNodes(final ReadWriteTransaction transaction) { Map<InstanceIdentifier<Node>, Node> bridgeNodes = new HashMap<>(); final InstanceIdentifier<Node> connectionIId = getOvsdbConnectionInstance().getInstanceIdentifier(); final Optional<Node> ovsdbNode = SouthboundUtil.readNode(transaction, connectionIId); if (ovsdbNode.isPresent()) { OvsdbNodeAugmentation ovsdbNodeAugmentation = ovsdbNode.get().augmentation(OvsdbNodeAugmentation.class); if (ovsdbNodeAugmentation != null) { final Map<ManagedNodeEntryKey, ManagedNodeEntry> managedNodeEntries = ovsdbNodeAugmentation.getManagedNodeEntry(); for (ManagedNodeEntry managedNodeEntry : managedNodeEntries.values()) { final InstanceIdentifier<Node> bridgeIid = (InstanceIdentifier<Node>) managedNodeEntry.getBridgeRef().getValue(); final Optional<Node> bridgeNode = SouthboundUtil.readNode(transaction, bridgeIid); if (bridgeNode.isPresent()) { bridgeNodes.put(bridgeIid, bridgeNode.get()); } else { LOG.warn("OVSDB bridge node was not found: {}", bridgeIid); } } } else { LOG.warn("OvsdbNodeAugmentation was not found: {}", connectionIId); } } else { LOG.warn("OVSDB node was not found: {}", connectionIId); } return bridgeNodes; } OvsdbControllerUpdateCommand(final OvsdbConnectionInstance key,
            final TableUpdates updates, final DatabaseSchema dbSchema); @Override void execute(final ReadWriteTransaction transaction);  }### Answer:
@SuppressWarnings("unchecked") @Test public void testGetBridgeNodes() throws Exception { OvsdbConnectionInstance ovsdbConnectionInstance = mock(OvsdbConnectionInstance.class); when(ovsdbControllerUpdateCommand.getOvsdbConnectionInstance()).thenReturn(ovsdbConnectionInstance); InstanceIdentifier<Node> connectionIId = mock(InstanceIdentifier.class); when(ovsdbConnectionInstance.getInstanceIdentifier()).thenReturn(connectionIId); PowerMockito.mockStatic(SouthboundUtil.class); ReadWriteTransaction transaction = mock(ReadWriteTransaction.class); Node node = mock(Node.class); Optional<Node> ovsdbNode = Optional.of(node); when(SouthboundUtil.readNode(transaction, connectionIId)).thenReturn(ovsdbNode); OvsdbNodeAugmentation ovsdbNodeAugmentation = mock(OvsdbNodeAugmentation.class); when(node.augmentation(OvsdbNodeAugmentation.class)).thenReturn(ovsdbNodeAugmentation); InstanceIdentifier<Node> bridgeIid = mock(InstanceIdentifier.class); ManagedNodeEntry managedNodeEntry = new ManagedNodeEntryBuilder() .setBridgeRef(new OvsdbBridgeRef(bridgeIid)) .build(); when(ovsdbNodeAugmentation.getManagedNodeEntry()).thenReturn(Map.of(managedNodeEntry.key(), managedNodeEntry)); Optional<Node> bridgeNode = Optional.of(node); when(SouthboundUtil.readNode(transaction, bridgeIid)).thenReturn(bridgeNode); Map<InstanceIdentifier<Node>, Node> testBridgeNodes = new HashMap<>(); testBridgeNodes.put(bridgeIid, node); assertEquals(testBridgeNodes, Whitebox.invokeMethod(ovsdbControllerUpdateCommand, "getBridgeNodes", transaction)); }