@Test
public void testDeviceNumberFromMajorAndMinor() throws IOException {

  createVeSlotFile(0);
  createVeSlotFile(1);
  createVeSlotFile(2);
  createOsStateFile(0);
  when(mockCommandExecutor.getOutput()).thenReturn(
      "10:1:character special file",
      "1d:2:character special file",
      "4:3c:character special file");
  when(udevUtil.getSysPath(anyInt(), anyChar())).thenReturn(testFolder);
  Set<Device> devices = discoverer.getDevicesFromPath(testFolder);
  List<Device> devicesList = Lists.newArrayList(devices);
  devicesList.sort(DEVICE_COMPARATOR);
  Device device0 = devicesList.get(0);
  assertEquals("Major number", 16, device0.getMajorNumber());
  assertEquals("Minor number", 1, device0.getMinorNumber());
  Device device1 = devicesList.get(1);
  assertEquals("Major number", 29, device1.getMajorNumber());
  assertEquals("Minor number", 2, device1.getMinorNumber());
  Device device2 = devicesList.get(2);
  assertEquals("Major number", 4, device2.getMajorNumber());
  assertEquals("Minor number", 60, device2.getMinorNumber());
}