DefaultValueConverterRegistry implements ValueConverterRegistry { @SuppressWarnings("unchecked") protected static <T> Class<T> boxify(final Class<T> type) { if (type.isPrimitive() && boxifyMap.containsKey(type)) { return (Class<T>) boxifyMap.get(type); } else { return type; } }  @Override T convertValue(final Value value, final Thing thing, final Class<T> desiredType); @Override Value convertType(T type, Thing thing); @Override Set<T> convertValues(Set<Value> values, Thing thing, Class<T> desiredType); @Override Set<Value> convertTypes(Set<T> types, Thing thing); @Override @SuppressWarnings("unchecked") ValueConverter<T> getValueConverter(final Class<T> type); @Override @Reference(multiple = true, dynamic = true, unbind = "unregisterValueConverter") void registerValueConverter(final ValueConverter<T> converter); @Override void unregisterValueConverter(final ValueConverter<T> converter);  }
@Test public void testBoxify() { TestCase.assertEquals(Integer.class, DefaultValueConverterRegistry.boxify(int.class)); TestCase.assertEquals(Byte.class, DefaultValueConverterRegistry.boxify(byte.class)); TestCase.assertEquals(Short.class, DefaultValueConverterRegistry.boxify(short.class)); TestCase.assertEquals(Long.class, DefaultValueConverterRegistry.boxify(long.class)); TestCase.assertEquals(Double.class, DefaultValueConverterRegistry.boxify(double.class)); TestCase.assertEquals(Float.class, DefaultValueConverterRegistry.boxify(float.class)); TestCase.assertEquals(Boolean.class, DefaultValueConverterRegistry.boxify(boolean.class)); TestCase.assertEquals(Character.class, DefaultValueConverterRegistry.boxify(char.class)); }