### Question:
OvsdbNodeRemoveCommand extends AbstractTransactionCommand { @VisibleForTesting boolean checkIfOnlyConnectedManager(OvsdbNodeAugmentation ovsdbNodeAugmentation) { ManagerEntry onlyConnectedManager = null; if (ovsdbNodeAugmentation != null) { int connectedManager = 0; final Map<ManagerEntryKey, ManagerEntry> entries = ovsdbNodeAugmentation.getManagerEntry(); if (entries != null) { for (ManagerEntry manager : entries.values()) { if (manager.isConnected()) { connectedManager++; if (connectedManager > ONE_CONNECTED_MANAGER) { return false; } onlyConnectedManager = manager; } } } if (connectedManager == 0) { return true; } if (onlyConnectedManager.getNumberOfConnections().toJava() > ONE_ACTIVE_CONNECTION_IN_PASSIVE_MODE) { return false; } } return true; } OvsdbNodeRemoveCommand(OvsdbConnectionInstance key,TableUpdates updates,DatabaseSchema dbSchema); @Override void execute(ReadWriteTransaction transaction);  }### Answer:
@Test public void testCheckIfOnlyConnectedManager() throws Exception { ManagerEntry manager = mock(ManagerEntry.class); ManagerEntry manager1 = mock(ManagerEntry.class); doReturn(new ManagerEntryKey(new Uri("manager"))).when(manager).key(); doReturn(new ManagerEntryKey(new Uri("manager1"))).when(manager1).key(); when(manager.isConnected()).thenReturn(true, false, true); when(manager1.isConnected()).thenReturn(true, false, true); when(manager.getNumberOfConnections()).thenReturn(Uint32.ZERO); Map<ManagerEntryKey, ManagerEntry> listManagerEntry = new HashMap<>(); listManagerEntry.put(manager.key(), manager); listManagerEntry.put(manager1.key(), manager1); OvsdbNodeAugmentation ovsdbNodeAugmentation = new OvsdbNodeAugmentationBuilder() .setManagerEntry(listManagerEntry) .build(); assertEquals(false, Whitebox.invokeMethod(ovsdbNodeRemoveCommand, "checkIfOnlyConnectedManager", ovsdbNodeAugmentation)); assertEquals(true, Whitebox.invokeMethod(ovsdbNodeRemoveCommand, "checkIfOnlyConnectedManager", ovsdbNodeAugmentation)); ManagerEntry onlyConnectedManager = mock(ManagerEntry.class); assertEquals(false, Whitebox.invokeMethod(ovsdbNodeRemoveCommand, "checkIfOnlyConnectedManager", ovsdbNodeAugmentation)); listManagerEntry.remove(manager1.key()); assertEquals(true, Whitebox.invokeMethod(ovsdbNodeRemoveCommand, "checkIfOnlyConnectedManager", ovsdbNodeAugmentation)); }