@Test
public void testDetectMultipleOnlineDevices() throws IOException {

  createVeSlotFile(0);
  createVeSlotFile(1);
  createVeSlotFile(2);
  createOsStateFile(0);
  when(mockCommandExecutor.getOutput()).thenReturn(
      "8:1:character special file",
      "9:1:character special file",
      "a:1:character special file");
  when(udevUtil.getSysPath(anyInt(), anyChar())).thenReturn(testFolder);
  Set<Device> devices = discoverer.getDevicesFromPath(testFolder);
  assertEquals("Number of devices", 3, devices.size());
  List<Device> devicesList = Lists.newArrayList(devices);
  devicesList.sort(DEVICE_COMPARATOR);
  Device device0 = devicesList.get(0);
  assertEquals("Device ID", 0, device0.getId());
  assertEquals("Major number", 8, device0.getMajorNumber());
  assertEquals("Minor number", 1, device0.getMinorNumber());
  assertEquals("Status", "ONLINE", device0.getStatus());
  assertTrue("Device is not healthy", device0.isHealthy());
  Device device1 = devicesList.get(1);
  assertEquals("Device ID", 1, device1.getId());
  assertEquals("Major number", 9, device1.getMajorNumber());
  assertEquals("Minor number", 1, device1.getMinorNumber());
  assertEquals("Status", "ONLINE", device1.getStatus());
  assertTrue("Device is not healthy", device1.isHealthy());
  Device device2 = devicesList.get(2);
  assertEquals("Device ID", 2, device2.getId());
  assertEquals("Major number", 10, device2.getMajorNumber());
  assertEquals("Minor number", 1, device2.getMinorNumber());
  assertEquals("Status", "ONLINE", device2.getStatus());
  assertTrue("Device is not healthy", device2.isHealthy());
}