// Path: app/src/main/java/com/tobi/movies/misc/AbstractObserver.java
// public abstract class AbstractObserver<T> implements Observer<T> {
//     @Override
//     public void onCompleted() {
//         //no-op
//     }
// 
//     @Override
//     public void onError(Throwable e) {
//         //no-op
//     }
// 
//     @Override
//     public void onNext(T t) {
//         //no-op
//     }
// }


import android.support.annotation.Nullable;
import com.tobi.movies.misc.AbstractObserver;
import rx.Scheduler;
import rx.Subscription;
    private Listener listener = NO_OP_LISTENER;

    public MovieDetailsUseCase(
            MovieDetailsRepository repository,
            Scheduler schedulerThread,
            Scheduler observerThread) {
        this.repository = repository;
        this.schedulerThread = schedulerThread;
        this.observerThread = observerThread;
    }

    @Nullable
    private MovieDetails movieDetails;

    @Override
    @Nullable
    public MovieDetails getMovieDetails() {
        return movieDetails;
    }

    @Override
    public void loadMovieDetails(long movieId) {
        if (subscription != null) {
            subscription.unsubscribe();
        }

        subscription = repository
                .getMovieDetails(movieId)
                .subscribeOn(schedulerThread)
                .observeOn(observerThread)
// Path: app/src/main/java/com/tobi/movies/misc/AbstractObserver.java
// public abstract class AbstractObserver<T> implements Observer<T> {
//     @Override
//     public void onCompleted() {
//         //no-op
//     }
// 
//     @Override
//     public void onError(Throwable e) {
//         //no-op
//     }
// 
//     @Override
//     public void onNext(T t) {
//         //no-op
//     }
// }


// Path: app/src/main/java/com/tobi/movies/posterdetails/MovieDetailsUseCase.java
import android.support.annotation.Nullable;
import com.tobi.movies.misc.AbstractObserver;
import rx.Scheduler;
import rx.Subscription;

    private Listener listener = NO_OP_LISTENER;

    public MovieDetailsUseCase(
            MovieDetailsRepository repository,
            Scheduler schedulerThread,
            Scheduler observerThread) {
        this.repository = repository;
        this.schedulerThread = schedulerThread;
        this.observerThread = observerThread;
    }

    @Nullable
    private MovieDetails movieDetails;

    @Override
    @Nullable
    public MovieDetails getMovieDetails() {
        return movieDetails;
    }

    @Override
    public void loadMovieDetails(long movieId) {
        if (subscription != null) {
            subscription.unsubscribe();
        }

        subscription = repository
                .getMovieDetails(movieId)
                .subscribeOn(schedulerThread)
                .observeOn(observerThread)
                .subscribe(new AbstractObserver<MovieDetails>() {