HttpConnectionRemoveFileTask extends AsyncTask<Void, Void, Void> { @SuppressWarnings("ResultOfMethodCallIgnored") @Override protected Void doInBackground(Void... params) { mFile.delete(); return null; } HttpConnectionRemoveFileTask(@NonNull File file);   }
@SuppressWarnings("ResultOfMethodCallIgnored") @Test public void doInBackground() { HttpConnectionRemoveFileTask task = new HttpConnectionRemoveFileTask(mFile); task.doInBackground(); verify(mFile).delete(); }