// Path: app/src/main/java/com/rxjava2/android/samples/ui/cache/model/Data.java
// public class Data {
// 
//     public String source;
// 
//     @SuppressWarnings("CloneDoesntDeclareCloneNotSupportedException")
//     @Override
//     public Data clone() {
//         return new Data();
//     }
// }


import com.rxjava2.android.samples.ui.cache.model.Data;
import io.reactivex.Observable;
package com.rxjava2.android.samples.ui.cache.source;



/**
 * Class to simulate Disk DataSource
 */
public class DiskDataSource {

    private Data data;

    public Observable<Data> getData() {
        return Observable.create(emitter -> {
            if (data != null) {
                emitter.onNext(data);
            }
            emitter.onComplete();
        });
    }

// Path: app/src/main/java/com/rxjava2/android/samples/ui/cache/model/Data.java
// public class Data {
// 
//     public String source;
// 
//     @SuppressWarnings("CloneDoesntDeclareCloneNotSupportedException")
//     @Override
//     public Data clone() {
//         return new Data();
//     }
// }


// Path: app/src/main/java/com/rxjava2/android/samples/ui/cache/source/DiskDataSource.java
import com.rxjava2.android.samples.ui.cache.model.Data;
import io.reactivex.Observable;

package com.rxjava2.android.samples.ui.cache.source;



/**
 * Class to simulate Disk DataSource
 */
public class DiskDataSource {

    private Data data;

    public Observable<Data> getData() {
        return Observable.create(emitter -> {
            if (data != null) {
                emitter.onNext(data);
            }
            emitter.onComplete();
        });
    }

    public void saveToDisk(Data data) {