class DockerfileGitHubUtil {

    public Optional<PagedSearchIterable<GHContent>> getGHContents(String org, String img)
            throws IOException, InterruptedException {
        PagedSearchIterable<GHContent> contentsWithImage = null;
        for (int i = 0; i < 5; i++) {
            contentsWithImage = findFilesWithImage(img, org);
            if (contentsWithImage.getTotalCount() > 0) {
                break;
            } else {
                getGitHubUtil().waitFor(TimeUnit.SECONDS.toMillis(1));
            }
        }

        int numOfContentsFound = contentsWithImage.getTotalCount();
        if (numOfContentsFound <= 0) {
            log.info("Could not find any repositories with given image: {}", img);
            return Optional.empty();
        }
        return Optional.of(contentsWithImage);
    }

    public  DockerfileGitHubUtil(GitHubUtil gitHubUtil);

}