public void check() {
    RunIterator iterate = iterator();
    int currentIndex = 0;
    int[] prevRun = iterate.next();
    int runLengthSum = prevRun[0];
    int[] currentRun;
    while(iterate.hasNext()){
      if (prevRun[0] <= 0) System.out.println("Run " + currentIndex + " has a length less than 1");   
      currentRun = iterate.next();
      if (currentRun[1] == prevRun[1] && currentRun[2] == prevRun[2] && currentRun[3] == prevRun[3]){
        System.out.println("Run " + currentIndex + "and " + currentIndex+1 + "have the same RGB values");
      }
      runLengthSum += currentRun[0];
      prevRun = currentRun;
      currentIndex++;
    }
    if (prevRun[0] <= 0) System.out.println("Run " + currentIndex + " has a length less than 1"); 
    if (runLengthSum != getWidth()*getHeight()) System.out.println("Incorrect number of runs");  
  }