Code review comment: Should we consider union of maps as well?

Code under review:
private List<LSCompletionItem> getTableTypeDescSymbols(BallerinaCompletionContext context, T node) {
        NonTerminalNode nodeAtCursor = context.getNodeAtCursor();
        Predicate<Symbol> predicate = symbol -> {
            if (symbol.kind() != SymbolKind.TYPE_DEFINITION) {
                return false;
            }
            TypeSymbol rawType = CommonUtil.getRawType(((TypeDefinitionSymbol) symbol).typeDescriptor());
            return rawType.typeKind() == TypeDescKind.MAP || rawType.typeKind() == TypeDescKind.RECORD ||
                    CommonUtil.isUnionOfType(rawType, TypeDescKind.RECORD);
        };

        if (QNameReferenceUtil.onQualifiedNameIdentifier(context, nodeAtCursor)) {
            QualifiedNameReferenceNode refNode = (QualifiedNameReferenceNode) nodeAtCursor;
            /*
            Covers the following
            (1) table<mod:*cursor*>
            (2) table<mod:x*cursor*>
             */
            List<Symbol> moduleContent = QNameReferenceUtil.getModuleContent(context, refNode, predicate);
            return this.getCompletionItemList(moduleContent, context);
        } else {
            /*
            Covers the following
            (1) table<*cursor*>
            (2) table<x*cursor*>
             */
            List<Symbol> filtered = context.visibleSymbols(context.getCursorPosition()).stream()
                    .filter(predicate)
                    .collect(Collectors.toList());
            List<LSCompletionItem> completionItems = new ArrayList<>();
            completionItems.addAll(this.getModuleCompletionItems(context));
            completionItems.addAll(this.getCompletionItemList(filtered, context));
            completionItems.addAll(Arrays.asList(
                    new SnippetCompletionItem(context, Snippet.KW_RECORD.get()),
                    new SnippetCompletionItem(context, Snippet.DEF_RECORD_TYPE_DESC.get()),
                    new SnippetCompletionItem(context, Snippet.DEF_CLOSED_RECORD_TYPE_DESC.get())));

            return completionItems;
        }
    }

Line commented on: CommonUtil.isUnionOfType(rawType, TypeDescKind.RECORD);

Revised code:
private List<LSCompletionItem> getTableTypeDescSymbols(BallerinaCompletionContext context, T node) {
        NonTerminalNode nodeAtCursor = context.getNodeAtCursor();
        Predicate<Symbol> predicate = symbol -> {
            if (symbol.kind() != SymbolKind.TYPE_DEFINITION) {
                return false;
            }
            TypeSymbol rawType = CommonUtil.getRawType(((TypeDefinitionSymbol) symbol).typeDescriptor());
            return rawType.typeKind() == TypeDescKind.MAP || CommonUtil.isUnionOfType(rawType, TypeDescKind.MAP) ||
                    rawType.typeKind() == TypeDescKind.RECORD || CommonUtil.isUnionOfType(rawType, TypeDescKind.RECORD);
        };

        if (QNameReferenceUtil.onQualifiedNameIdentifier(context, nodeAtCursor)) {
            QualifiedNameReferenceNode refNode = (QualifiedNameReferenceNode) nodeAtCursor;
            /*
            Covers the following
            (1) table<mod:*cursor*>
            (2) table<mod:x*cursor*>
             */
            List<Symbol> moduleContent = QNameReferenceUtil.getModuleContent(context, refNode, predicate);
            return this.getCompletionItemList(moduleContent, context);
        } else {
            /*
            Covers the following
            (1) table<*cursor*>
            (2) table<x*cursor*>
             */
            List<Symbol> filtered = context.visibleSymbols(context.getCursorPosition()).stream()
                    .filter(predicate)
                    .collect(Collectors.toList());
            List<LSCompletionItem> completionItems = new ArrayList<>();
            completionItems.addAll(this.getModuleCompletionItems(context));
            completionItems.addAll(this.getCompletionItemList(filtered, context));
            completionItems.addAll(Arrays.asList(
                    new SnippetCompletionItem(context, Snippet.KW_RECORD.get()),
                    new SnippetCompletionItem(context, Snippet.DEF_RECORD_TYPE_DESC.get()),
                    new SnippetCompletionItem(context, Snippet.DEF_CLOSED_RECORD_TYPE_DESC.get())));

            return completionItems;
        }
    }