### Question:
Generator { public UastNode uast() { return uast; } Generator(String source); static void main(String[] args); static Set<String> allKindNames(); UastNode uast(); String json();  }### Answer:
@Test void generate() { String source = "class A {\n" + " void foo() {\n" + " System.out.println(\"yolo\");\n" + " }\n" + "}"; Generator generator = new Generator(source); UastNode cutNode = generator.uast(); assertEquals("COMPILATION_UNIT", cutNode.nativeNode); assertEquals(null, cutNode.token); assertEquals(Collections.singleton(UastNode.Kind.COMPILATION_UNIT), cutNode.kinds); assertEquals(2, cutNode.children.size()); UastNode classNode = cutNode.children.get(0); assertEquals("CLASS", classNode.nativeNode); assertNull(classNode.token); assertEquals(EnumSet.of(CLASS, STATEMENT, TYPE), classNode.kinds); assertEquals(5, classNode.children.size()); UastNode eofToken = cutNode.children.get(1); assertEquals("TOKEN", eofToken.nativeNode); assertNotNull(eofToken.token); assertEquals(5, eofToken.token.line); assertEquals(2, eofToken.token.column); assertEquals("", eofToken.token.value); assertEquals(Collections.singleton(EOF), eofToken.kinds); assertEquals(0, eofToken.children.size()); }