public static DeclaredType asDeclared(TypeMirror maybeDeclaredType) {
        return maybeDeclaredType.accept(new CastingTypeVisitor<DeclaredType>() {
            @Override
            public DeclaredType visitDeclared(DeclaredType type, String ignored) {
                return type;
            }
        }, "declared type");
    }
Utilities related to {@link TypeMirror} instances.

@author Gregory Kick
@since 2.0
android/annotation_processors/permission-requester-compiler/src/main/java/github/tornaco/permission/compiler/common/MoreTypes.java