class TakeSnapshotTask implements Callable<Snapshot> {

    Statistics collectStatistics(final OrganizationWrapper organization) throws IOException {
        logger.info("Started collecting statistics for organization '{}'.", organisationName);

        Statistics statistics = new Statistics(organization.getId(), snapshotDate);

        statistics.setPublicProjectCount(organization.listRepositories().size());
        statistics.setMembersCount(organization.listMembers().size());
        statistics.setTeamsCount(organization.listTeams().size());
        statistics.setAllContributorsCount((int) organization.listRepositories().stream()
                .map(RepositoryWrapper::listContributors)
                .flatMap(List::stream)
                .map(GHRepository.Contributor::getId)
                .distinct()
                .count());
        statistics.setExternalContributorsCount((int) organization.listRepositories().stream()
                .map(RepositoryWrapper::listContributors)
                .flatMap(List::stream)
                .filter(contributor -> !organization.contributorIsMember(contributor))
                .map(GHRepository.Contributor::getId)
                .distinct()
                .count());
        statistics.setAllStarsCount(organization.listRepositories().stream()
                .map(RepositoryWrapper::getStarsCount)
                .reduce(0, Integer::sum));
        statistics.setAllForksCount(organization.listRepositories().stream()
                .map(RepositoryWrapper::getForksCount)
                .reduce(0, Integer::sum));
        statistics.setAllSizeCount(organization.listRepositories().stream()
                .map(RepositoryWrapper::getSize)
                .reduce(0, Integer::sum));
        statistics.setProgramLanguagesCount((int) organization.listRepositories().stream()
                .map(RepositoryWrapper::getPrimaryLanguage)
                .distinct()
                .count());
        statistics.setTagsCount((int) organization.listRepositories().stream()
                .map(RepositoryWrapper::listTags)
                .flatMap(List::stream)
                .count());
        statistics.setOrganizationName(organization.getLogin());

        logger.info("Finished collecting statistics for organization '{}'.", organisationName);

        return statistics;
    }

    public  TakeSnapshotTask(final GitHub gitHub, final String organisationName, Scorer scorer, Date snapshotDate);

}