### Question:
LongConverter implements AtlasConverter<Long> { @AtlasConversionInfo(sourceType = FieldType.LONG, targetType = FieldType.BYTE, concerns = AtlasConversionConcern.RANGE) public Byte toByte(Long value) throws AtlasConversionException { if (value == null) { return null; } if (value >= Byte.MIN_VALUE && value <= Byte.MAX_VALUE) { return value.byteValue(); } throw new AtlasConversionException(new AtlasUnsupportedException( String.format("Long %s is greater than Byte.MAX_VALUE or less than Byte.MIN_VALUE", value))); }  @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 convertToByte() throws Exception { Long l = 0L; Byte value = (byte) 0; assertEquals(value, converter.toByte(l)); }
@Test(expected = AtlasConversionException.class) public void convertToByteOutOfRange() throws Exception { converter.toByte(Long.MAX_VALUE); }
@Test public void convertToByteNull() throws Exception { assertNull(converter.toByte(null)); }