public void removeAndroidDevice(AndroidDevice device) throws DeviceStoreException {
    if (device == null) {
      return;
    }
    boolean hardwareDevice = device instanceof DefaultHardwareDevice;
    if (hardwareDevice == false) {
      throw new DeviceStoreException("Only devices of type 'DefaultHardwareDevice' can be removed.");
    }

    release(device, null);
    DeviceTargetPlatform apiLevel = device.getTargetPlatform();
    if (androidDevices.containsKey(apiLevel)) {
      log.info("Removing: " + device);
      androidDevices.get(apiLevel).remove(device);
      if (androidDevices.get(apiLevel).isEmpty()) {
        androidDevices.remove(apiLevel);
      }
    } else {
      for (List<AndroidDevice> targetDevices : androidDevices.values()) {
        if (targetDevices.contains(device)) {
          log.warning("Device in devicestore");
        }
      }
      log.warning("The target platform version of the device is not found in device store.");
      log.warning("The device was propably already removed.");
    }
  }
Removes the given device from store so that it cannot be any longer be used for testing. This
can happen if e.g. the hardware device gets unplugged from the computer.

@param device the device to remove.
@throws DeviceStoreException when parameter is not type of 'DefaultHardwareDevice'.
selendroid-standalone/src/main/java/io/selendroid/standalone/server/model/DeviceStore.java