package feedmeyoutubecrawler.crawler;

import feedmeyoutubecore.obj.YouTubeVideo;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/* Copyright (C) 2015 Robert Lehmann <lehmrob@gmail.com>
 *
 * This software may be modified and distributed under the terms
 * of the MIT license.  See the LICENSE file for details.
 */
/**
 * This is the main crawler class which runs the crawler
 *
 * @author Robert Lehmann
 * @since 1.0
 */
public class Crawler {

    private final VideoCrawler _videoCrawler;
    private final YouTubeConnection _connection;
    
    private static final Logger LOG = LoggerFactory.getLogger(Crawler.class);

    /**
     * Constructor for the {@link Crawler}
     *
     * @throws IOException Error occurs during authorisation of the craweler
     * @since 1.0
     */
    public Crawler() throws IOException {
        _connection = new YouTubeConnection();
        _videoCrawler = new VideoCrawler(_connection);
    }

    /**
     * Crawl the information from the youtube account
     *
     * @throws IOException Can't connect to YouTube.
     * @since 1.0
     */
    public void crawl() throws IOException {
        final List<YouTubeVideo> list = new ArrayList<>();
        
        while (_videoCrawler.hasNext()) {
            System.out.println("Next");
            list.addAll(_videoCrawler.getNextVideos());
        }
        
        list.stream().forEach(video -> {
            LOG.info(video.VideoTitle);
        });
        
        System.out.println(list);
    }
}

@@ -1,223 +1,4 @@
-package feedmeyoutubecrawler.crawler;%0A%0Aimport feedmeyoutubecore.obj.YouTubeVideo;%0Aimport java.io.IOException;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0A
 /* C
@@ -184,68 +184,167 @@
  */%0A
-/**%0A * This is the main crawler class which runs the
+%0Apackage feedmeyoutubecrawler.crawler;%0A%0Aimport java.io.IOException;%0Aimport java.util.List;%0A%0A/**%0A * This interface defines the methodes for the diffrent
  crawler
 %0A *%0A
@@ -339,16 +339,17 @@
  crawler
+.
 %0A *%0A * @
@@ -399,552 +399,486 @@
 lic 
-class Crawler %7B%0A%0A    private final VideoCrawler _videoCrawler;%0A    private final YouTubeConnection _connection;%0A
+interface Crawler%3CT%3E %7B%0A    /**%0A     * Check if there are more elements to crawl.%0A 
     
+*
 %0A    
-private static final Logger LOG = LoggerFactory.getLogger(Crawler.class);%0A%0A    /**%0A     * Constructor for the %7B@link C
+ * This methode looks if there are more elements availible at youtube which can be c
 rawle
-r%7D
+d by
 %0A     *
-%0A     * @throws IOException Error occurs during authorisation of the craweler%0A     * @since 1.0%0A     */%0A    public Crawler() throws IOException %7B%0A        _connection = new YouTubeConnection();%0A        _videoCrawler = new VideoCrawler(_connection);%0A    %7D%0A%0A    /**%0A     * Crawl the information
+ the application%0A     * @return %7B@code true%7D if there are more elements to crawl, else return %7B@code false%7D.%0A     * @since 1.0%0A     */%0A    boolean hasNext();%0A%0A    /**%0A     * Gets a list of next elements from the web service.%0A     *%0A     * This methode returns a list of crawled elements
  fro
@@ -887,520 +887,236 @@
 the 
-yout
+YouT
 ube 
-account%0A     *%0A     * @throws IOException Can't connect to YouTube.%0A     * @since 1.0%0A     */%0A    public void crawl() throws IOException %7B%0A        final List%3CYouTubeVideo%3E list = new ArrayList%3C%3E();%0A        %0A        while (_videoCrawler.hasNext()) %7B%0A            System.out.println(%22Next%22);%0A   
+web service.%0A     * @return %7B@link List%7D of elements from the type %7B@link T%7D%0A     * @throws IOException Can't crawl the next elements from the webservice%0A     * @since 1.0%0A
      
+*/%0A
     
-list.addAll(_videoCrawler.getNextVideos());%0A        %7D%0A        %0A        list.stream().forEach(video -%3E %7B%0A            LOG.info(video.VideoTitle);%0A        %7D);%0A        %0A        System.out.println(list);%0A    %7D
+List%3CT%3E getNext() throws IOException;
 %0A%7D%0A

Replace class with an common interface