public void randReplaceBaseTest(int numTests, int numTestsPerSeq, int lenMask, long seed) {
		Random rand = new Random(seed);

		for( int t = 0; t < numTests; t++ ) {
			String seq = "";
			int len = (rand.nextInt() & lenMask) + 10; // Randomly select sequence length
			seq = randSeq(len, rand); // Create a random sequence

			DnaNSequence bseq = new DnaNSequence(seq);

			// Replace numTestsPerSeq random bases from the sequence
			if( verbose ) System.out.println("randReplaceBaseTest\nOri    :\t" + seq);
			for( int i = 0; i < numTestsPerSeq; i++ ) {
				// Random position
				int randPos = rand.nextInt(len);
				char baseOri = seq.charAt(randPos);

				// Random base (different than baseOri)
				char randBase = baseOri;
				while(randBase == baseOri)
					randBase = randBase(rand);

				// Replace base in sequence (string)
				char seqChars[] = seq.toCharArray();
				seqChars[randPos] = randBase;
				seq = new String(seqChars);

				// Replace i DnaNSequence
				bseq.setBase(randPos, randBase);
				if( verbose ) System.out.println("Changed:\t" + seq + "\tpos: " + randPos + "\trandbase: " + randBase + "\n\t\t" + bseq);

				// Compare results
				Assert.assertEquals(seq, bseq.toString());
			}
		}
	}