### Question:
ParseFile implements Parcelable { public Task<File> getFileInBackground(final ProgressCallback progressCallback) { final TaskCompletionSource<Void> cts = new TaskCompletionSource<>(); currentTasks.add(cts); return taskQueue.enqueue(new Continuation<Void, Task<File>>() { @Override public Task<File> then(Task<Void> toAwait) throws Exception { return fetchInBackground(progressCallback, toAwait, cts.getTask()); } }).continueWithTask(new Continuation<File, Task<File>>() { @Override public Task<File> then(Task<File> task) throws Exception { cts.trySetResult(null); currentTasks.remove(cts); return task; } }); } ParseFile(File file);  ParseFile(File file, String contentType);  ParseFile(String name, byte[] data, String contentType);  ParseFile(byte[] data);  ParseFile(String name, byte[] data);  ParseFile(byte[] data, String contentType); protected  ParseFile(Parcel source);   ParseFile(Parcel source, ParseParcelDecoder decoder);   ParseFile(State state); @SuppressWarnings("unused")  ParseFile(JSONObject json, ParseDecoder decoder); String getName(); boolean isDirty(); boolean isDataAvailable(); String getUrl(); void save(); Task<Void> saveInBackground(final ProgressCallback uploadProgressCallback); Task<Void> saveInBackground(); void saveInBackground(final SaveCallback saveCallback,
      ProgressCallback progressCallback); void saveInBackground(SaveCallback callback); byte[] getData(); Task<byte[]> getDataInBackground(final ProgressCallback progressCallback); Task<byte[]> getDataInBackground(); void getDataInBackground(GetDataCallback dataCallback,
      final ProgressCallback progressCallback); void getDataInBackground(GetDataCallback dataCallback); File getFile(); Task<File> getFileInBackground(final ProgressCallback progressCallback); Task<File> getFileInBackground(); void getFileInBackground(GetFileCallback fileCallback,
      final ProgressCallback progressCallback); void getFileInBackground(GetFileCallback fileCallback); InputStream getDataStream(); Task<InputStream> getDataStreamInBackground(final ProgressCallback progressCallback); Task<InputStream> getDataStreamInBackground(); void getDataStreamInBackground(GetDataStreamCallback dataStreamCallback,
      final ProgressCallback progressCallback); void getDataStreamInBackground(GetDataStreamCallback dataStreamCallback); void cancel(); @Override int describeContents(); @Override void writeToParcel(Parcel dest, int flags); final static Creator<ParseFile> CREATOR; }### Answer:
@Test public void testGetFileAsyncSuccess() throws Exception { String content = "content"; File file = temporaryFolder.newFile("test"); ParseFileUtils.writeStringToFile(file, content, "UTF-8"); ParseFileController controller = mock(ParseFileController.class); when(controller.fetchAsync( any(ParseFile.State.class), any(String.class), any(ProgressCallback.class), Matchers.<Task<Void>>any())).thenReturn(Task.forResult(file)); ParseCorePlugins.getInstance().registerFileController(controller); String url = "url"; ParseFile.State state = new ParseFile.State.Builder() .url(url) .build(); ParseFile parseFile = new ParseFile(state); File fetchedFile = ParseTaskUtils.wait(parseFile.getFileInBackground()); ArgumentCaptor<ParseFile.State> stateCaptor = ArgumentCaptor.forClass(ParseFile.State.class); verify(controller, times(1)).fetchAsync( stateCaptor.capture(), anyString(), any(ProgressCallback.class), Matchers.<Task<Void>>any() ); assertEquals(url, stateCaptor.getValue().url()); assertArrayEquals(content.getBytes(), ParseFileUtils.readFileToByteArray(fetchedFile)); File fetchedFileAgain = ParseTaskUtils.wait(parseFile.getFileInBackground()); ArgumentCaptor<ParseFile.State> stateCaptorAgain = ArgumentCaptor.forClass(ParseFile.State.class); verify(controller, times(2)).fetchAsync( stateCaptorAgain.capture(), anyString(), any(ProgressCallback.class), Matchers.<Task<Void>>any() ); assertEquals(url, stateCaptorAgain.getValue().url()); assertArrayEquals(content.getBytes(), ParseFileUtils.readFileToByteArray(fetchedFileAgain)); }