public static Page createSequencePage(List<? extends Type> types, int length, int... initialValues)
{
Block[] blocks = new Block[initialValues.length];
for (int i = 0; i < blocks.length; i++) {
Type type = types.get(i);
int initialValue = initialValues[i];
if (type.equals(BIGINT)) {
blocks[i] = BlockAssertions.createLongSequenceBlock(initialValue, initialValue + length);
}
else if (type.equals(DOUBLE)) {
blocks[i] = BlockAssertions.createDoubleSequenceBlock(initialValue, initialValue + length);
}
else if (type.equals(VARCHAR)) {
blocks[i] = BlockAssertions.createStringSequenceBlock(initialValue, initialValue + length);
}
else if (type.equals(BOOLEAN)) {
blocks[i] = BlockAssertions.createBooleanSequenceBlock(initialValue, initialValue + length);
}
else if (type.equals(DATE)) {
blocks[i] = BlockAssertions.createDateSequenceBlock(initialValue, initialValue + length);
}
else if (type.equals(TIMESTAMP)) {
blocks[i] = BlockAssertions.createTimestampSequenceBlock(initialValue, initialValue + length);
}
else {
throw new IllegalStateException("Unsupported type " + type);
}
}
return new Page(blocks);
}