class CinemaResponseToCinema {

    public List<Cinema> map(CinemaResponse cinemaResponse) {
        List<Cinema> cinemas = new ArrayList<>();
        if (cinemaResponse.getCinemas() != null){
            for (int i = 0; i < cinemaResponse.getCinemas().size(); i++){
                final Cinema cinema = new Cinema();
                final CinemaNetwork response = cinemaResponse.getCinemas().get(i);
                cinema.setPage(cinemaResponse.getPage());
                cinema.setTotalPages(cinemaResponse.getTotalPages());
                cinema.setTotalResults(cinemaResponse.getTotalResults());
                cinema.setId(response.getId());
                cinema.setVoteAverage(response.getVoteAverage());
                cinema.setTitle(response.getTitle());
                cinema.setAdult(response.isAdult());
                cinema.setDescription(response.getDescription());
                cinema.setPosterUrl(response.getPosterUrl());
                cinema.setReleaseDate(response.getReleaseDate());
                cinema.setPopularity(response.getPopularity());
                cinema.setGenres(response.getGenreIds());
                cinemas.add(cinema);
            }
        }
        return cinemas;
    }

}