ImplicitConversions { @Nullable public static Object convert(@Nonnull Object sourceValue, @Nonnull BuiltinDataType targetType) { BuiltinDataType sourceType = BuiltinDataType.fromBackingClass(sourceValue.getClass()); if (sourceType == null) { return null; } if (!sourceType.getBackingClass().isAssignableFrom(sourceValue.getClass())) { return null; } return convert(sourceValue, sourceType, targetType); }  @Nullable static Object convert(@Nonnull Object sourceValue, @Nonnull BuiltinDataType targetType); static int getPrecedence(@Nonnull BuiltinDataType dataType);  }
@Test public void testConvert() { assertEquals( convert(false, BuiltinDataType.Byte), ubyte(0)); assertEquals( convert(true, BuiltinDataType.Byte), ubyte(1)); }