@Test
public void get() throws Exception {

  // Arrange
  IDevice device = Mockito.mock(IDevice.class);
  // noinspection UnstableApiUsage
  Mockito.when(myAndroidDebugBridge.getConnectedDevices()).thenReturn(Futures.immediateFuture(Collections.singletonList(device)));
  ConnectedDevicesTask task = new ConnectedDevicesTask(myAndroidDebugBridge, true, null, MoreExecutors.directExecutor(), d -> null);
  // Act
  Future<List<ConnectedDevice>> devices = task.get();
  // Assert
  assertEquals(Collections.emptyList(), devices.get(1, TimeUnit.SECONDS));
}