### Question:
JVMClass { public static void generateDTS(PrintWriter writer, String fqcn) { final Class<?> clazz; try { clazz = Class.forName(fqcn); } catch (ClassNotFoundException e) { System.err.println("Can't process: " + fqcn); return; } writer.printf(""); writer.printf("export %s%s %s {\n", Modifier.isAbstract(clazz.getModifiers()) ? "abstract " : "", clazz.isInterface() ? "interface" : "class", getSimpleName(clazz)); writer.println(); for (Field field : clazz.getFields()) { if (isBlacklisted(getSimpleName(clazz), field.getName(), null)) { continue; } if (Modifier.isPublic(field.getModifiers())) { if (field.isAnnotationPresent(Deprecated.class)) { writer.println(" "); } writer.printf(" %s%s : %s;\n", Modifier.isStatic(field.getModifiers()) ? "static " : "", field.getName(), genType(field.getGenericType().getTypeName())); writer.println(); } } for (Constructor<?> constructor : clazz.getConstructors()) { if (isBlacklisted(getSimpleName(clazz), "<ctor>", Arrays.asList(constructor.getParameterTypes()))) { continue; } if (Modifier.isPublic(constructor.getModifiers())) { writer.printf(" "); writer.printf(" constructor(%s);\n", getParamDefinition(constructor.getGenericParameterTypes())); writer.println(); } } for (Method method : clazz.getMethods()) { if (isBlacklisted(getSimpleName(clazz), method.getName(), Arrays.asList(method.getParameterTypes()))) { continue; } if (Modifier.isPublic(method.getModifiers())) { writer.printf(" "); writer.printf(" %s%s(%s) : %s;\n", Modifier.isStatic(method.getModifiers()) ? "static " : "", method.getName(), getParamDefinition(method.getParameterTypes()), genType(method.getGenericReturnType().getTypeName())); writer.println(); } } writer.println("}"); writer.println(); }  static void generateJS(PrintWriter writer, String fqcn); static void generateMJS(PrintWriter writer, String fqcn); static void generateDTS(PrintWriter writer, String fqcn);  }### Answer:
@Test public void test() { StringWriter sw = new StringWriter(); JVMClass.generateDTS(new PrintWriter(sw), "java.lang.String"); System.out.println(sw.toString()); }