for (Number sample : sampledList.build()) {
if (getType() == BIGINT) {
builder.appendLong(sample.longValue());
}
else if (getType() == DOUBLE) {
builder.appendDouble(sample.doubleValue());
}
else {
throw new AssertionError("Can only handle longs and doubles");
}
}