@Test
public void getImpl() {

  // Arrange
  AndroidDevice pixel2ApiQAndroidDevice = Mockito.mock(AndroidDevice.class);
  VirtualDevice pixel2ApiQVirtualDevice = new VirtualDevice.Builder()
    .setName("Pixel 2 API Q")
    .setKey(new Key("Pixel_2_API_Q"))
    .setAndroidDevice(pixel2ApiQAndroidDevice)
    .build();
  VirtualDevice pixel3ApiQVirtualDevice = new VirtualDevice.Builder()
    .setName("Pixel 3 API Q")
    .setKey(new Key("Pixel_3_API_Q"))
    .setAndroidDevice(Mockito.mock(AndroidDevice.class))
    .build();
  AndroidDevice googlePixel3AndroidDevice = Mockito.mock(AndroidDevice.class);
  ConnectedDevice googlePixel3ConnectedDevice = new ConnectedDevice.Builder()
    .setName("Physical Device")
    .setKey(new Key("86UX00F4R"))
    .setAndroidDevice(googlePixel3AndroidDevice)
    .build();
  Mockito.when(myGetName.apply(googlePixel3ConnectedDevice)).thenReturn("Google Pixel 3");
  AndroidDevice pixel3ApiQAndroidDevice = Mockito.mock(AndroidDevice.class);
  Mockito.when(pixel3ApiQAndroidDevice.isVirtual()).thenReturn(true);
  ConnectedDevice pixel3ApiQConnectedDevice = new ConnectedDevice.Builder()
    .setName("Virtual Device")
    .setKey(new Key("Pixel_3_API_Q"))
    .setAndroidDevice(pixel3ApiQAndroidDevice)
    .build();
  // Act
  Object actualDevices = myGetter.getImpl(
    Arrays.asList(pixel2ApiQVirtualDevice, pixel3ApiQVirtualDevice),
    Arrays.asList(googlePixel3ConnectedDevice, pixel3ApiQConnectedDevice));
  // Assert
  Object expectedPixel3ApiQDevice = new VirtualDevice.Builder()
    .setName("Pixel 3 API Q")
    .setKey(new Key("Pixel_3_API_Q"))
    .setConnectionTime(Instant.parse("2018-11-28T01:15:27.000Z"))
    .setAndroidDevice(pixel3ApiQAndroidDevice)
    .build();
  Object expectedGooglePixel3Device = new PhysicalDevice.Builder()
    .setName("Google Pixel 3")
    .setKey(new Key("86UX00F4R"))
    .setConnectionTime(Instant.parse("2018-11-28T01:15:27.000Z"))
    .setAndroidDevice(googlePixel3AndroidDevice)
    .build();
  Object expectedPixel2ApiQDevice = new VirtualDevice.Builder()
    .setName("Pixel 2 API Q")
    .setKey(new Key("Pixel_2_API_Q"))
    .setAndroidDevice(pixel2ApiQAndroidDevice)
    .build();
  assertEquals(Arrays.asList(expectedPixel3ApiQDevice, expectedGooglePixel3Device, expectedPixel2ApiQDevice), actualDevices);
}