PrimaryIndexBucketLocatorImpl implements BucketLocator { protected static Long convertIntegerToBucketingLong(Integer integer) { if (integer == null) { return null; } if (integer == Integer.MIN_VALUE) { integer++; } long toReturn = integer.longValue(); return toReturn; } private  PrimaryIndexBucketLocatorImpl(); @Deprecated  PrimaryIndexBucketLocatorImpl(List<Long> textBuckets, List<Long> dateTimeBuckets,
            List<Long> doubleBuckets, List<Long> integerBuckets, List<Long> booleanBuckets,
            List<Long> uuidBuckets, List<Long> binaryBuckets, List<Long> longBuckets, List<Long> timepointBuckets); static PrimaryIndexBucketLocatorImpl getInstance(); @Override Long getBucket(Object bucketingObject, FieldDataType dataType); static Long convertObjectToBucketingToken(Object toBeConverted, FieldDataType dataType); static List<Long>[] getBUCKETS();  }
@Test public void testIntegerToLongNull() { logger.debug("test convertIntegerToBucketingLong with null value"); Long testNull = PrimaryIndexBucketLocatorImpl.convertIntegerToBucketingLong(null); assertTrue("a null value was expected instead received" + testNull, testNull == null); }
@Test public void testIntegerMinvalue() { logger.debug("test convertIntegerToBucketingLong with min value value"); Long testNull = PrimaryIndexBucketLocatorImpl.convertIntegerToBucketingLong(0); assertFalse("a null value was expected instead received" + testNull, testNull == null); }
@Test public void testConvertIntegerToBucketingLong() { logger.debug("convertIntegerToBucketingLong"); Integer integer = Integer.MAX_VALUE; integer = 0; Long result = PrimaryIndexBucketLocatorImpl.convertIntegerToBucketingLong(integer); assertNearZeroLongValue(result); integer = Integer.MIN_VALUE + 1; assertTrue("Function not monotonically increasing.", PrimaryIndexBucketLocatorImpl.convertIntegerToBucketingLong(1) < PrimaryIndexBucketLocatorImpl.convertIntegerToBucketingLong(2)); assertTrue("Function not monotonically increasing.", PrimaryIndexBucketLocatorImpl.convertIntegerToBucketingLong(2) < PrimaryIndexBucketLocatorImpl.convertIntegerToBucketingLong(3)); assertTrue("Function not monotonically increasing.", PrimaryIndexBucketLocatorImpl.convertIntegerToBucketingLong(-2) < PrimaryIndexBucketLocatorImpl.convertIntegerToBucketingLong(-1)); }