### Question:
ParseFile implements Parcelable { public boolean isDataAvailable() { return data != null || getFileController().isDataAvailable(state); } 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 testIsDataAvailableCachedInMemory() { ParseFile file = new ParseFile(new ParseFile.State.Builder().build()); file.data = "hello".getBytes(); assertTrue(file.isDataAvailable()); }
@Test public void testIsDataAvailableCachedInController() { ParseFileController controller = mock(ParseFileController.class); when(controller.isDataAvailable(any(ParseFile.State.class))).thenReturn(true); ParseCorePlugins.getInstance().registerFileController(controller); ParseFile.State state = new ParseFile.State.Builder().build(); ParseFile file = new ParseFile(state); assertTrue(file.isDataAvailable()); verify(controller).isDataAvailable(state); }