### Question:
DataValueGenerator { public String generateNativeObject(Class<?> tClass) { return generateNativeObject(DataValueModels.acquireModel(tClass)); }  static Class firstPrimitiveFieldType(Class valueClass); static String bytesType(Class type); static String simpleName(Class<?> type); static CharSequence normalize(Class aClass); static Method getGetter(FieldModel model); static Method getVolatileGetter(FieldModel model); static Method getSetter(FieldModel model); static Method getOrderedSetter(FieldModel model); static void appendImported(SortedSet<Class> imported, StringBuilder sb); static void appendPackage(DataValueModel<?> dvmodel, StringBuilder sb); static String getPackage(DataValueModel<?> dvmodel); static int fieldSize(FieldModel model); static TreeSet<Class> newImported(); static boolean shouldImport(Class type); static Map.Entry<String, FieldModel>[] heapSizeOrderedFieldsGrouped(DataValueModel<?> dvmodel); static int computeOffset(int offset, FieldModel model); static int computeNonScalarOffset(DataValueModel dvmodel, Class type); T heapInstance(Class<T> tClass); Class acquireHeapClass(Class<T> tClass); T nativeInstance(Class<T> tClass); Class acquireNativeClass(Class<T> tClass); String generateNativeObject(Class<?> tClass); String generateNativeObject(DataValueModel<?> dvmodel); boolean isDumpCode(); void setDumpCode(boolean dumpCode);  }### Answer:
@Test public void testGenerateNativeWithGetUsing() throws ClassNotFoundException, IllegalAccessException, InstantiationException { String actual = new DataValueGenerator().generateNativeObject(JavaBeanInterfaceGetUsing.class); System.out.println(actual); CachedCompiler cc = new CachedCompiler(null, null); Class aClass = cc.loadFromJava(JavaBeanInterfaceGetUsing.class.getName() + "$$Native", actual); JavaBeanInterfaceGetUsing jbi = (JavaBeanInterfaceGetUsing) aClass.asSubclass(JavaBeanInterfaceGetUsing.class).newInstance(); Bytes bytes = ByteBufferBytes.wrap(ByteBuffer.allocate(64)); ((Byteable) jbi).bytes(bytes, 0L); jbi.setString("G'day"); assertEquals("G'day", jbi.getUsingString(new StringBuilder()).toString()); }
@Test public void testGenerateNativeWithHasArrays() throws ClassNotFoundException, IllegalAccessException, InstantiationException { String actual = new DataValueGenerator().generateNativeObject(HasArraysInterface.class); System.out.println(actual); CachedCompiler cc = new CachedCompiler(null, null); Class aClass = cc.loadFromJava(HasArraysInterface.class.getName() + "$$Native", actual); HasArraysInterface hai = (HasArraysInterface) aClass.asSubclass(HasArraysInterface.class).newInstance(); Bytes bytes = ByteBufferBytes.wrap(ByteBuffer.allocate(152)); ((Byteable) hai).bytes(bytes, 0L); hai.setStringAt(0, "G'day"); assertEquals("G'day", hai.getStringAt(0)); }