// Path: app/src/main/java/com/starter/data/Repository.java
// public interface Repository {
//     Observable<List<Contributor>> contributors(String owner, String repo);
// }
// 
// Path: app/src/main/java/com/starter/data/local/LocalRepository.java
// public class LocalRepository implements Repository {
//     private final Box<ContributorEntity> localContributorBox;
//     private final ThreadConfiguration threadConfiguration;
//     private final ContributorsJsonsToContributorEntitiesMapper
//         contributorsJsonsToContributorEntitiesMapper =
//         new ContributorsJsonsToContributorEntitiesMapper();
//     private final ContributorsEntitiesToContributorsMapper entitiesToContributorsMapper =
//         new ContributorsEntitiesToContributorsMapper();
// 
//     public LocalRepository(final Box<ContributorEntity> localContributorBox,
//         final ThreadConfiguration threadConfiguration) {
//         this.localContributorBox = localContributorBox;
//         this.threadConfiguration = threadConfiguration;
//     }
// 
//     @Override
//     public Observable<List<Contributor>> contributors(final String owner, final String repo) {
//         return Observable.defer(() -> Observable.just(localContributorBox.getAll()))
//             .flatMap(contributorEntities -> Observable.just(
//                 entitiesToContributorsMapper.map(contributorEntities)))
//             .compose(threadConfiguration.applySchedulers());
//     }
// 
//     public void put(final List<ContributorJson> contributorJsons) {
//         localContributorBox.put(contributorsJsonsToContributorEntitiesMapper.map(contributorJsons));
//     }
// }
// 
// Path: app/src/main/java/com/starter/data/model/Contributor.java
// public final class Contributor {
//     private final String login;
//     private final int contributions;
//     private final String avatarUrl;
// 
//     public Contributor(final String login, final int contributions, final String avatarUrl) {
//         this.login = login;
//         this.contributions = contributions;
//         this.avatarUrl = avatarUrl;
//     }
// 
//     public Contributor(final ContributorJson contributorJson) {
//         this.login = contributorJson.getLogin();
//         this.contributions = contributorJson.getContributions();
//         this.avatarUrl = contributorJson.getAvatarUrl();
//     }
// 
//     public Contributor(final ContributorEntity contributorEntity) {
//         this.login = contributorEntity.getLogin();
//         this.contributions = contributorEntity.getContributions();
//         this.avatarUrl = contributorEntity.getAvatarUrl();
//     }
// 
//     @Override
//     public boolean equals(final Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
// 
//         final Contributor that = (Contributor) o;
// 
//         if (contributions != that.contributions) return false;
//         if (login != null ? !login.equals(that.login) : that.login != null) return false;
//         return avatarUrl != null ? avatarUrl.equals(that.avatarUrl) : that.avatarUrl == null;
//     }
// 
//     @Override
//     public int hashCode() {
//         int result = login != null ? login.hashCode() : 0;
//         result = 31 * result + contributions;
//         result = 31 * result + (avatarUrl != null ? avatarUrl.hashCode() : 0);
//         return result;
//     }
// 
//     public String getLogin() {
//         return login;
//     }
// 
//     public int getContributions() {
//         return contributions;
//     }
// 
//     public String getAvatarUrl() {
//         return avatarUrl;
//     }
// }
// 
// Path: app/src/main/java/com/starter/data/model/mappers/ContributorsJsonsToContributorListMapper.java
// public class ContributorsJsonsToContributorListMapper
//     implements Mapper<List<ContributorJson>, List<Contributor>> {
// 
//     @Override
//     public List<Contributor> map(final List<ContributorJson> contributors) {
//         List<Contributor> contributorEntities = new ArrayList<>();
//         for (ContributorJson contributor : contributors) {
//             contributorEntities.add(new Contributor(contributor));
//         }
// 
//         return contributorEntities;
//     }
// }
// 
// Path: app/src/main/java/com/starter/utils/ThreadConfiguration.java
// public class ThreadConfiguration {
//     private Scheduler subscribeOnScheduler;
//     private Scheduler observeOnScheduler;
// 
//     public ThreadConfiguration(final Scheduler subscribeOnScheduler,
//         final Scheduler observeOnScheduler) {
//         this.subscribeOnScheduler = subscribeOnScheduler;
//         this.observeOnScheduler = observeOnScheduler;
//     }
// 
//     public <T> Observable.Transformer<T, T> applySchedulers() {
//         return observable -> observable.subscribeOn(subscribeOnScheduler)
//             .observeOn(observeOnScheduler);
//     }
// }


import android.support.annotation.NonNull;
import com.starter.data.Repository;
import com.starter.data.local.LocalRepository;
import com.starter.data.model.Contributor;
import com.starter.data.model.mappers.ContributorsJsonsToContributorListMapper;
import com.starter.utils.ThreadConfiguration;
import java.io.IOException;
import java.util.List;
import javax.inject.Inject;
import rx.Observable;
package com.starter.data.remote;


public class RemoteRepository implements Repository {

    private final LocalRepository localRepository;
    private final ThreadConfiguration threadConfiguration;
    private final GithubApi githubApi;
    private final ContributorsJsonsToContributorListMapper
        contributorsJsonsToContributorListMapper = new ContributorsJsonsToContributorListMapper();

    @Inject
    public RemoteRepository(final LocalRepository localRepository, @NonNull GithubApi githubApi,
// Path: app/src/main/java/com/starter/data/Repository.java
// public interface Repository {
//     Observable<List<Contributor>> contributors(String owner, String repo);
// }
// 
// Path: app/src/main/java/com/starter/data/local/LocalRepository.java
// public class LocalRepository implements Repository {
//     private final Box<ContributorEntity> localContributorBox;
//     private final ThreadConfiguration threadConfiguration;
//     private final ContributorsJsonsToContributorEntitiesMapper
//         contributorsJsonsToContributorEntitiesMapper =
//         new ContributorsJsonsToContributorEntitiesMapper();
//     private final ContributorsEntitiesToContributorsMapper entitiesToContributorsMapper =
//         new ContributorsEntitiesToContributorsMapper();
// 
//     public LocalRepository(final Box<ContributorEntity> localContributorBox,
//         final ThreadConfiguration threadConfiguration) {
//         this.localContributorBox = localContributorBox;
//         this.threadConfiguration = threadConfiguration;
//     }
// 
//     @Override
//     public Observable<List<Contributor>> contributors(final String owner, final String repo) {
//         return Observable.defer(() -> Observable.just(localContributorBox.getAll()))
//             .flatMap(contributorEntities -> Observable.just(
//                 entitiesToContributorsMapper.map(contributorEntities)))
//             .compose(threadConfiguration.applySchedulers());
//     }
// 
//     public void put(final List<ContributorJson> contributorJsons) {
//         localContributorBox.put(contributorsJsonsToContributorEntitiesMapper.map(contributorJsons));
//     }
// }
// 
// Path: app/src/main/java/com/starter/data/model/Contributor.java
// public final class Contributor {
//     private final String login;
//     private final int contributions;
//     private final String avatarUrl;
// 
//     public Contributor(final String login, final int contributions, final String avatarUrl) {
//         this.login = login;
//         this.contributions = contributions;
//         this.avatarUrl = avatarUrl;
//     }
// 
//     public Contributor(final ContributorJson contributorJson) {
//         this.login = contributorJson.getLogin();
//         this.contributions = contributorJson.getContributions();
//         this.avatarUrl = contributorJson.getAvatarUrl();
//     }
// 
//     public Contributor(final ContributorEntity contributorEntity) {
//         this.login = contributorEntity.getLogin();
//         this.contributions = contributorEntity.getContributions();
//         this.avatarUrl = contributorEntity.getAvatarUrl();
//     }
// 
//     @Override
//     public boolean equals(final Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
// 
//         final Contributor that = (Contributor) o;
// 
//         if (contributions != that.contributions) return false;
//         if (login != null ? !login.equals(that.login) : that.login != null) return false;
//         return avatarUrl != null ? avatarUrl.equals(that.avatarUrl) : that.avatarUrl == null;
//     }
// 
//     @Override
//     public int hashCode() {
//         int result = login != null ? login.hashCode() : 0;
//         result = 31 * result + contributions;
//         result = 31 * result + (avatarUrl != null ? avatarUrl.hashCode() : 0);
//         return result;
//     }
// 
//     public String getLogin() {
//         return login;
//     }
// 
//     public int getContributions() {
//         return contributions;
//     }
// 
//     public String getAvatarUrl() {
//         return avatarUrl;
//     }
// }
// 
// Path: app/src/main/java/com/starter/data/model/mappers/ContributorsJsonsToContributorListMapper.java
// public class ContributorsJsonsToContributorListMapper
//     implements Mapper<List<ContributorJson>, List<Contributor>> {
// 
//     @Override
//     public List<Contributor> map(final List<ContributorJson> contributors) {
//         List<Contributor> contributorEntities = new ArrayList<>();
//         for (ContributorJson contributor : contributors) {
//             contributorEntities.add(new Contributor(contributor));
//         }
// 
//         return contributorEntities;
//     }
// }
// 
// Path: app/src/main/java/com/starter/utils/ThreadConfiguration.java
// public class ThreadConfiguration {
//     private Scheduler subscribeOnScheduler;
//     private Scheduler observeOnScheduler;
// 
//     public ThreadConfiguration(final Scheduler subscribeOnScheduler,
//         final Scheduler observeOnScheduler) {
//         this.subscribeOnScheduler = subscribeOnScheduler;
//         this.observeOnScheduler = observeOnScheduler;
//     }
// 
//     public <T> Observable.Transformer<T, T> applySchedulers() {
//         return observable -> observable.subscribeOn(subscribeOnScheduler)
//             .observeOn(observeOnScheduler);
//     }
// }


// Path: app/src/main/java/com/starter/data/remote/RemoteRepository.java
import android.support.annotation.NonNull;
import com.starter.data.Repository;
import com.starter.data.local.LocalRepository;
import com.starter.data.model.Contributor;
import com.starter.data.model.mappers.ContributorsJsonsToContributorListMapper;
import com.starter.utils.ThreadConfiguration;
import java.io.IOException;
import java.util.List;
import javax.inject.Inject;
import rx.Observable;

package com.starter.data.remote;


public class RemoteRepository implements Repository {

    private final LocalRepository localRepository;
    private final ThreadConfiguration threadConfiguration;
    private final GithubApi githubApi;
    private final ContributorsJsonsToContributorListMapper
        contributorsJsonsToContributorListMapper = new ContributorsJsonsToContributorListMapper();

    @Inject
    public RemoteRepository(final LocalRepository localRepository, @NonNull GithubApi githubApi,
        @NonNull ThreadConfiguration threadConfiguration) {