// Path: app/src/main/java/com/xurxodev/moviesandroidkata/domain/boundary/executor/AsyncExecutor.java
// public interface AsyncExecutor {
// 
//     void run(final UseCase interactor);
// }
// 
// Path: app/src/main/java/com/xurxodev/moviesandroidkata/domain/boundary/executor/MainExecutor.java
// public interface MainExecutor {
//     void run(final Runnable runnable);
// }
// 
// Path: app/src/main/java/com/xurxodev/moviesandroidkata/domain/boundary/Repository/MovieRepository.java
// public interface MovieRepository {
//     List<Movie> getMovies();
// 
//     Movie getMovieByTitle(String movieTitle);
// }
// 
// Path: app/src/main/java/com/xurxodev/moviesandroidkata/domain/entity/Movie.java
// public class Movie {
//     private String image;
//     private String title;
//     private String overview;
// 
//     public Movie(String image, String title, String overview) {
//         this.image = image;
//         this.title = title;
//         this.overview = overview;
//     }
// 
//     public String getImage() {
//         return image;
//     }
// 
//     public String getTitle() {
//         return title;
//     }
// 
//     public String getOverview() {
//         return overview;
//     }
// }


import com.xurxodev.moviesandroidkata.domain.boundary.executor.AsyncExecutor;
import com.xurxodev.moviesandroidkata.domain.boundary.executor.MainExecutor;
import com.xurxodev.moviesandroidkata.domain.boundary.repository.MovieRepository;
import com.xurxodev.moviesandroidkata.domain.entity.Movie;
        this.competitorRepository = competitorRepository;
        this.asyncExecutor = asyncExecutor;
        this.mainExecutor = mainExecutor;
    }

    public void execute(String movieTitle, Callback callback) {
        this.movieTitle = movieTitle;

        this.callback = callback;
        this.asyncExecutor.run(this);
    }

    @Override
    public void run() {
        Movie movie = competitorRepository.getMovieByTitle(this.movieTitle);

        notifyCompetitorDetailsLoaded(movie);

        //TODO:call to notify error
    }

    private void notifyError() {
        mainExecutor.run(new Runnable() {
            @Override
            public void run() {
                callback.onConnectionError();
            }
        });
    }

// Path: app/src/main/java/com/xurxodev/moviesandroidkata/domain/boundary/executor/AsyncExecutor.java
// public interface AsyncExecutor {
// 
//     void run(final UseCase interactor);
// }
// 
// Path: app/src/main/java/com/xurxodev/moviesandroidkata/domain/boundary/executor/MainExecutor.java
// public interface MainExecutor {
//     void run(final Runnable runnable);
// }
// 
// Path: app/src/main/java/com/xurxodev/moviesandroidkata/domain/boundary/Repository/MovieRepository.java
// public interface MovieRepository {
//     List<Movie> getMovies();
// 
//     Movie getMovieByTitle(String movieTitle);
// }
// 
// Path: app/src/main/java/com/xurxodev/moviesandroidkata/domain/entity/Movie.java
// public class Movie {
//     private String image;
//     private String title;
//     private String overview;
// 
//     public Movie(String image, String title, String overview) {
//         this.image = image;
//         this.title = title;
//         this.overview = overview;
//     }
// 
//     public String getImage() {
//         return image;
//     }
// 
//     public String getTitle() {
//         return title;
//     }
// 
//     public String getOverview() {
//         return overview;
//     }
// }


// Path: app/src/main/java/com/xurxodev/moviesandroidkata/domain/usecase/GetMovieDetailUseCase.java
import com.xurxodev.moviesandroidkata.domain.boundary.executor.AsyncExecutor;
import com.xurxodev.moviesandroidkata.domain.boundary.executor.MainExecutor;
import com.xurxodev.moviesandroidkata.domain.boundary.repository.MovieRepository;
import com.xurxodev.moviesandroidkata.domain.entity.Movie;

        this.competitorRepository = competitorRepository;
        this.asyncExecutor = asyncExecutor;
        this.mainExecutor = mainExecutor;
    }

    public void execute(String movieTitle, Callback callback) {
        this.movieTitle = movieTitle;

        this.callback = callback;
        this.asyncExecutor.run(this);
    }

    @Override
    public void run() {
        Movie movie = competitorRepository.getMovieByTitle(this.movieTitle);

        notifyCompetitorDetailsLoaded(movie);

        //TODO:call to notify error
    }

    private void notifyError() {
        mainExecutor.run(new Runnable() {
            @Override
            public void run() {
                callback.onConnectionError();
            }
        });
    }

    private void notifyCompetitorDetailsLoaded(final Movie movie) {