public void testMinMaxOnDoubleArrayPartition() {
double min = Double.MAX_VALUE;
double max = Double.MIN_VALUE;
// Normal case
DoubleArrayPartition p = new StaticDoubleArrayPartition(rand.nextInt(1000), 1000);
for(int i = p.getIndexStart(), end = p.getIndexEnd(); i < end; i++) {
double val = rand.nextDouble();
if(val > max) max = val;
if(val < min) min = val;
p.set(i, val);
}
assertEquals(max, Stores.max(p));
assertEquals(min, Stores.min(p));