public static void stop(boolean force) {
        if (!force) {
            try {
                List<JSONObject> samples = samplesQueue.take(MAX_DELAY);
                if (samples.size() > 0) {
                    send(samples, callBackUrl.toString());
                }
            } catch (InterruptedException ie) {
                BmLog.debug("Interrupted exception during finishing SamplesUploader: " + ie.getMessage());
            }
        } else {
            if (isRunning()) {
                task.cancel(true);
                BmLog.info("Samples uploading is finished: " + Constants.CALLBACK_URL + "=" + callBackUrl);
            }
        }
    }