### Question:
LongConverter implements AtlasConverter<Long> { @AtlasConversionInfo(sourceType = FieldType.LONG, targetType = FieldType.INTEGER, concerns = AtlasConversionConcern.RANGE) public Integer toInteger(Long value) throws AtlasConversionException { if (value == null) { return null; } if (value > Integer.MAX_VALUE || value < Integer.MIN_VALUE) { throw new AtlasConversionException( String.format("Long %s is greater than Integer.MAX_VALUE or less than Integer.MIN_VALUE", value)); } return value.intValue(); }  @AtlasConversionInfo(sourceType = FieldType.LONG, targetType = FieldType.DECIMAL) BigDecimal toBigDecimal(Long value); @AtlasConversionInfo(sourceType = FieldType.LONG, targetType = FieldType.BIG_INTEGER) BigInteger toBigInteger(Long value); @AtlasConversionInfo(sourceType = FieldType.LONG, targetType = FieldType.BOOLEAN, concerns = AtlasConversionConcern.CONVENTION) Boolean toBoolean(Long value); @AtlasConversionInfo(sourceType = FieldType.LONG, targetType = FieldType.BYTE, concerns = AtlasConversionConcern.RANGE) Byte toByte(Long value); @AtlasConversionInfo(sourceType = FieldType.LONG, targetType = FieldType.CHAR, concerns = { AtlasConversionConcern.RANGE, AtlasConversionConcern.CONVENTION }) Character toCharacter(Long value); @AtlasConversionInfo(sourceType = FieldType.LONG, targetType = FieldType.DATE_TIME_TZ) Date toDate(Long date); @AtlasConversionInfo(sourceType = FieldType.LONG, targetType = FieldType.DOUBLE) Double toDouble(Long value); @AtlasConversionInfo(sourceType = FieldType.LONG, targetType = FieldType.FLOAT) Float toFloat(Long value); @AtlasConversionInfo(sourceType = FieldType.LONG, targetType = FieldType.INTEGER, concerns = AtlasConversionConcern.RANGE) Integer toInteger(Long value); @AtlasConversionInfo(sourceType = FieldType.LONG, targetType = FieldType.DATE) LocalDate toLocalDate(Long value); @AtlasConversionInfo(sourceType = FieldType.LONG, targetType = FieldType.TIME) LocalTime toLocalTime(Long value); @AtlasConversionInfo(sourceType = FieldType.LONG, targetType = FieldType.DATE_TIME) LocalDateTime toLocalDateTime(Long value); @AtlasConversionInfo(sourceType = FieldType.LONG, targetType = FieldType.LONG) Long toLong(Long value); @AtlasConversionInfo(sourceType = FieldType.LONG, targetType = FieldType.SHORT, concerns = AtlasConversionConcern.RANGE) Short toShort(Long value); @AtlasConversionInfo(sourceType = FieldType.LONG, targetType = FieldType.NUMBER) Number toNumber(Long value); @AtlasConversionInfo(sourceType = FieldType.LONG, targetType = FieldType.STRING) String toString(Long value); @AtlasConversionInfo(sourceType = FieldType.LONG, targetType = FieldType.DATE_TIME_TZ) ZonedDateTime toZonedDateTime(Long value);  }### Answer:
@Test public void convertToInteger() throws Exception { Long l = 0L; Integer i = converter.toInteger(l); assertNotNull(i); assertEquals(0, i, 0.0); }
@Test(expected = AtlasConversionException.class) public void convertToIntegerMAX() throws Exception { converter.toInteger(Long.MAX_VALUE); }
@Test(expected = AtlasConversionException.class) public void convertToIntegerMIN() throws Exception { converter.toInteger(Long.MIN_VALUE); }
@Test public void convertToIntegerNull() throws Exception { Long l = null; Integer i = converter.toInteger(l); assertNull(i); }