}
@Test
public void testEnumWithNestedClass()
{
JavaEnum javaEnum = (JavaEnum) JavaParser
.parse("package org.example; public enum OuterEnum { " +
" FOO, BAR, BAZ; " +
" public class InnerClass1{ " +
" public class InnerClass3{}" +
" } " +
" public class InnerClass2{} " +
"}");
Assert.assertEquals("org.example.OuterEnum", javaEnum.getCanonicalName());
List<JavaSource<?>> nestedClasses = javaEnum.getNestedClasses();
JavaSource<?> inner1 = nestedClasses.get(0);
JavaSource<?> inner2 = nestedClasses.get(1);
Assert.assertEquals(javaEnum, inner1.getEnclosingType());
Assert.assertEquals("org.example.OuterEnum.InnerClass1", inner1.getCanonicalName());
Assert.assertEquals("org.example.OuterEnum$InnerClass1", inner1.getQualifiedName());