@Test
public void testDeviceDisplayName() {

  IDevice device = mock(IDevice.class);
  when(device.getSerialNumber()).thenReturn("Serial");
  when(device.getProperty(IDevice.PROP_DEVICE_MANUFACTURER)).thenReturn("Manufacturer");
  when(device.getProperty(IDevice.PROP_DEVICE_MODEL)).thenReturn("Model");
  assertThat(AndroidProfilerToolWindow.getDeviceDisplayName(device)).isEqualTo("Manufacturer Model");
  IDevice deviceWithEmptyManufacturer = mock(IDevice.class);
  when(deviceWithEmptyManufacturer.getSerialNumber()).thenReturn("Serial");
  when(deviceWithEmptyManufacturer.getProperty(IDevice.PROP_DEVICE_MODEL)).thenReturn("Model");
  assertThat(AndroidProfilerToolWindow.getDeviceDisplayName(deviceWithEmptyManufacturer)).isEqualTo("Model");
  IDevice deviceWithSerialInModel = mock(IDevice.class);
  when(deviceWithSerialInModel.getSerialNumber()).thenReturn("Serial");
  when(deviceWithSerialInModel.getProperty(IDevice.PROP_DEVICE_MANUFACTURER)).thenReturn("Manufacturer");
  when(deviceWithSerialInModel.getProperty(IDevice.PROP_DEVICE_MODEL)).thenReturn("Model-Serial");
  assertThat(AndroidProfilerToolWindow.getDeviceDisplayName(deviceWithSerialInModel)).isEqualTo("Manufacturer Model");
}