@Test public void testEnumClassEntries() { Tree tree = kotlin("enum class A { B, C, D }"); assertTree(tree).isInstanceOf(ClassDeclarationTree.class); assertThat(tree.descendants().noneMatch(ClassDeclarationTree.class::isInstance)).isTrue(); }
private static Stream<PsiElement> descendants(PsiElement element) { return Arrays.stream(element.getChildren()).flatMap( tree -> Stream.concat(Stream.of(tree), descendants(tree))); }
KotlinConverter implements ASTConverter { private static Stream<PsiElement> descendants(PsiElement element) { return Arrays.stream(element.getChildren()).flatMap( tree -> Stream.concat(Stream.of(tree), descendants(tree))); } }
KotlinConverter implements ASTConverter { private static Stream<PsiElement> descendants(PsiElement element) { return Arrays.stream(element.getChildren()).flatMap( tree -> Stream.concat(Stream.of(tree), descendants(tree))); }  }
KotlinConverter implements ASTConverter { private static Stream<PsiElement> descendants(PsiElement element) { return Arrays.stream(element.getChildren()).flatMap( tree -> Stream.concat(Stream.of(tree), descendants(tree))); }  @Override Tree parse(String content); }
KotlinConverter implements ASTConverter { private static Stream<PsiElement> descendants(PsiElement element) { return Arrays.stream(element.getChildren()).flatMap( tree -> Stream.concat(Stream.of(tree), descendants(tree))); }  @Override Tree parse(String content);  }