int p;
Token[] tokens = new Token[100000];
Partitioner partitioner = new Partitioner();
for (int i = 0; i < 100000; i++)
tokens[i] = new Token(null, null, 1 - i, 0, 0, 0);
p = partitioner.partition(tokens, 100000, 3000);
Assert.assertEquals(p, 2999);
testSorted(tokens, p);
for (int i = 0; i < 100000; i++)
tokens[i] = new Token(null, null, i, 0, 0, 0);
p = partitioner.partition(tokens, 100000, 3000);
Assert.assertEquals(p, 2999);
testSorted(tokens, p);
for (int i = 0; i < 100000; i++)
tokens[i] = new Token(null, null, 0, 0, 0, 0);
p = partitioner.partition(tokens, 100000, 3000);
Assert.assertEquals(p, 2999);
testSorted(tokens, p);
for (int i = 0; i < 100000; i++)
tokens[i] = new Token(null, null, (float) Math.random(), 0, 0, 0);
p = partitioner.partition(tokens, 100000, 3000);
Assert.assertEquals(p, 2999);
testSorted(tokens, p);
}