### Question:
Declarations { public TypeDeclaration newTypeDeclaration(Class<?> clazz) { assertNotNull(clazz); TypeMirror type = ctx.getMoreTypes().getTypeMirror(clazz); return newTypeDeclaration(type); } Declarations(Context ctx); TypeDeclaration newUnknownTypeDeclaration(); TypeDeclaration newPrimitiveBooleanTypeDeclaration(); TypeDeclaration newTypeDeclaration(Class<?> clazz); TypeDeclaration newTypeDeclaration(TypeMirror type); TypeDeclaration newTypeDeclaration(TypeElement typeElement);  }### Answer:
@Test void newTypeDeclaration_Class() { addProcessor( new TestProcessor() { @Override protected void run() { TypeDeclaration typeDeclaration = ctx.getDeclarations().newTypeDeclaration(List.class); assertNotNull(typeDeclaration); assertTrue( ctx.getMoreTypes().isSameTypeWithErasure(typeDeclaration.getType(), List.class)); } }); }
@Test void newTypeDeclaration_TypeMirror() { addProcessor( new TestProcessor() { @Override protected void run() { TypeMirror type = ctx.getMoreTypes().getTypeMirror(List.class); TypeDeclaration typeDeclaration = ctx.getDeclarations().newTypeDeclaration(type); assertNotNull(typeDeclaration); assertTrue( ctx.getMoreTypes().isSameTypeWithErasure(typeDeclaration.getType(), List.class)); } }); }
@Test void newTypeDeclaration_TypeElement() { addProcessor( new TestProcessor() { @Override protected void run() { TypeElement typeElement = ctx.getMoreElements().getTypeElement(List.class); TypeDeclaration typeDeclaration = ctx.getDeclarations().newTypeDeclaration(typeElement); assertNotNull(typeDeclaration); assertTrue( ctx.getMoreTypes().isSameTypeWithErasure(typeDeclaration.getType(), List.class)); } }); }