public void testNext() throws IOException {
System.out.println("testNext");
String seq = "AAAAAAAAAG-CCCCCCCCUGAGGGUUACnAA";
String seq2 = "NNNNNNNNNNNNNNNNNNNAUGACGGUAGCGACAGAAGAAGNNNNNNNNN";
GoodWordIterator wordIt;
int seqLen = seq.length();
wordIt = new GoodWordIterator(seq);
int numOfWords = wordIt.getNumofWords();
//System.err.println("seqlen: " +seqLen + " numOfWords: " + numOfWords );
assertEquals( numOfWords, 14);
if( wordIt.hasNext() ){
assertEquals( wordIt.next(), 0); //AAAAAAAA
}
wordIt.next();
if( wordIt.hasNext() ){
assertEquals( wordIt.next(),2); //AAAAAAAG
}
if( wordIt.hasNext() ){
assertEquals( wordIt.next(), ( 256*256 -1)); //CCCCCCCC
}
if( wordIt.hasNext() ){
assertEquals(wordIt.next(), (256*256 -3)); //CCCCCCCU
}
wordIt = new GoodWordIterator(seq, 5);
numOfWords = wordIt.getNumofWords();
assertEquals( numOfWords, 5);
}