private Predicate<AndroidDevice> deviceSatisfiesCapabilities(final SelendroidCapabilities capabilities) {
    return new Predicate<AndroidDevice>() {
      @Override
      public boolean apply(AndroidDevice candidate) {
        ArrayList<Boolean> booleanExpressions = Lists.newArrayList(
            candidate.screenSizeMatches(capabilities.getScreenSize()),
            capabilities.getEmulator() == null ? true : capabilities.getEmulator() ?
                candidate instanceof DefaultAndroidEmulator : candidate instanceof DefaultHardwareDevice,
            StringUtils.isNotBlank(capabilities.getSerial()) ? capabilities.getSerial().equals(candidate.getSerial()) : true,
            StringUtils.isNotBlank(capabilities.getModel()) ? candidate.getModel().contains(capabilities.getModel()) : true,
            StringUtils.isNotBlank(capabilities.getAPITargetType()) ? candidate.getAPITargetType() != null
                && candidate.getAPITargetType().contains(capabilities.getAPITargetType()) : true
        );

        return Iterables.all(booleanExpressions, Predicates.equalTo(true));
      }
    };
  }
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