Consider use of an "UNDEFINED" constant (or overridable method) in place of -1 here?
Elsewhere, in https://github.com/elasticsearch/elasticsearch/pull/6143/files#diff-2cdb75b1d8a27a17cd3df51df6995ae6R55 there is a reference to testing for undefined values using  `shardSize` on the default object returned by getDefaultBucketCountThresholds() - but shardSize is mutable - if anyone happens to call `ensureValidity` on this default object then its shardSize setting would change from -1 to 10 which seems dangerous.