public String remainder(){
  final String remainder=queue.substring(pos,queue.length());
  pos=queue.length();
  return remainder;
}

public String remainder ( ) { final String remainder = queue . substring ( pos , queue . length ( ) ) ; pos = queue . length ( ) ; return remainder ; }
consume and return whatever is left on the queue .
