diff --git a/core/src/test/java/org/elasticsearch/common/unit/ByteSizeValueTests.java b/core/src/test/java/org/elasticsearch/common/unit/ByteSizeValueTests.java index d9010136ca0..7cf96b49bb0 100644 --- a/core/src/test/java/org/elasticsearch/common/unit/ByteSizeValueTests.java +++ b/core/src/test/java/org/elasticsearch/common/unit/ByteSizeValueTests.java @@ -208,7 +208,7 @@ public class ByteSizeValueTests extends AbstractWireSerializingTestCase= Long.MAX_VALUE / unit.toBytes(1)) { + if (size > Long.MAX_VALUE / unit.toBytes(1)) { throw new AssertionError(); } return new ByteSizeValue(size, unit);