Program: 60144
Project: 60144
Buggy source:
/** 
 * Returns a view of   {@code iterable} that skips its first{@code numberToSkip} elements. If {@code iterable} contains fewer than{@code numberToSkip} elements, the returned iterable skips all of itselements. <p>Modifications to the underlying  {@link Iterable} before a call to{@code iterator()} are reflected in the returned iterator. That is, theiterator skips the first  {@code numberToSkip} elements that exist when the{@code Iterator} is created, not when {@code skip()} is called.<p>The returned iterable's iterator supports  {@code remove()} if theiterator of the underlying iterable supports it. Note that it is <i>not</i> possible to delete the last skipped element by immediately calling  {@code remove()} on that iterator, as the {@code Iterator}contract states that a call to   {@code remove()} before a call to{@code next()} will throw an {@link IllegalStateException}.
 * @since 3.0
 */
public static <T>Iterable<T> skip(final Iterable<T> iterable,final int numberToSkip){
  checkNotNull(iterable);
  checkArgument(numberToSkip >= 0,"String_Node_Str");
  if (iterable instanceof List) {
    final List<T> list=(List<T>)iterable;
    return new FluentIterable<T>(){
      @Override public Iterator<T> iterator(){
        return (numberToSkip >= list.size()) ? Iterators.<T>emptyIterator() : list.subList(numberToSkip,list.size()).iterator();
      }
    }
;
  }
  return new FluentIterable<T>(){
    @Override public Iterator<T> iterator(){
      final Iterator<T> iterator=iterable.iterator();
      Iterators.advance(iterator,numberToSkip);
      return new Iterator<T>(){
        boolean atStart=true;
        @Override public boolean hasNext(){
          return iterator.hasNext();
        }
        @Override public T next(){
          if (!hasNext()) {
            throw new NoSuchElementException();
          }
          try {
            return iterator.next();
          }
  finally {
            atStart=false;
          }
        }
        @Override public void remove(){
          if (atStart) {
            throw new IllegalStateException();
          }
          iterator.remove();
        }
      }
;
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Returns a view of   {@code iterable} that skips its first{@code numberToSkip} elements. If {@code iterable} contains fewer than{@code numberToSkip} elements, the returned iterable skips all of itselements. <p>Modifications to the underlying  {@link Iterable} before a call to{@code iterator()} are reflected in the returned iterator. That is, theiterator skips the first  {@code numberToSkip} elements that exist when the{@code Iterator} is created, not when {@code skip()} is called.<p>The returned iterable's iterator supports  {@code remove()} if theiterator of the underlying iterable supports it. Note that it is <i>not</i> possible to delete the last skipped element by immediately calling  {@code remove()} on that iterator, as the {@code Iterator}contract states that a call to   {@code remove()} before a call to{@code next()} will throw an {@link IllegalStateException}.
 * @since 3.0
 */
public static <T>Iterable<T> skip(final Iterable<T> iterable,final int numberToSkip){
  checkNotNull(iterable);
  checkArgument(numberToSkip >= 0,"String_Node_Str");
  if (iterable instanceof List) {
    final List<T> list=(List<T>)iterable;
    return new FluentIterable<T>(){
      @Override public Iterator<T> iterator(){
        int toSkip=Math.min(list.size(),numberToSkip);
        return list.subList(toSkip,list.size()).iterator();
      }
    }
;
  }
  return new FluentIterable<T>(){
    @Override public Iterator<T> iterator(){
      final Iterator<T> iterator=iterable.iterator();
      Iterators.advance(iterator,numberToSkip);
      return new Iterator<T>(){
        boolean atStart=true;
        @Override public boolean hasNext(){
          return iterator.hasNext();
        }
        @Override public T next(){
          T result=iterator.next();
          atStart=false;
          return result;
        }
        @Override public void remove(){
          Iterators.checkRemove(!atStart);
          iterator.remove();
        }
      }
;
    }
  }
;
}