private boolean isEmulatorSwitchedOff(AndroidDevice device) throws DeviceStoreException {
    if (device instanceof AndroidEmulator) {
      try {
        return !((AndroidEmulator) device).isEmulatorStarted();
      } catch (AndroidDeviceException e) {
        throw new DeviceStoreException(e);
      }
    }
    return true;
  }
Finds a device for the requested capabilities. <b>important note:</b> if the device is not any
longer used, call the {@link #release(AndroidDevice, AndroidApp)} method.

@param caps The desired test session capabilities.
@return Matching device for a test session.
@throws DeviceStoreException
@see {@link #release(AndroidDevice, AndroidApp)}
selendroid-standalone/src/main/java/io/selendroid/standalone/server/model/DeviceStore.java