ByteConversions { @Nullable static Object explicitConversion(@Nonnull UByte b, BuiltinDataType targetType) { switch (targetType) { case Boolean: return byteToBoolean(b); case String: return byteToString(b); default: return implicitConversion(b, targetType); } } private  ByteConversions();   }
@Test public void testConversions() { for (Object[] conversion : CONVERSIONS) { UByte b = (UByte) conversion[0]; Object expected = conversion[1]; BuiltinDataType targetType = BuiltinDataType .fromBackingClass(expected.getClass()); assertNotNull(targetType); assertEquals(explicitConversion(b, targetType), expected); } }