Trie implementation – getWords and getWordsWithPrefix

I am trying to learn and implement a Trie data structure in Java. This is not a home work I am trying to learn and implement a trie , with Arrays, as opposed to Map. I am looking for a way to get all the word in a trie, and get all the words as per the prefix , in my implementation of TrieNode

Below is my Java code

import java.util.Arrays;

public class Solution
{
  private TrieNode root;
  
  public Solution()
  {
    root = new TrieNode();
  }
  
  public void insert(String word)
  {
    TrieNode current = root;
    for(int index = 0;index < word.length();index++)
    {
      char value = word.charAt(index);
      if(!current.containsKey(value))
      {
        current.put(value, new TrieNode()); 
      }
      current = current.get(value);
    }
    current.setEnd();
  }
  
  public TrieNode searchPrefix(String word)
  {
    TrieNode current = root;
    for(int index = 0;index < word.length();index++)
    {
      char value = word.charAt(index);
      if(current.containsKey(value))
      {
        current = current.get(value);
      }
      else
      {
        return null;
      } 
    }
    return current;
  }
  
  public boolean search(String word)
  {
    TrieNode node = searchPrefix(word);
    return node != null && node.isEnd();
  }
  
  public boolean startsWith(String word)
  {
    TrieNode node = searchPrefix(word);
    return node != null;
  }
  
  public int wordCount(TrieNode root)
  {
    int result = 0;
    
    if(root.isEnd())
    {
      result++;
    }
    
    for(int index = 0;index < 26;index++)
    {
      if(root.links[index] != null)
      {
        result += wordCount(root.links[index]);
      }
    }
    return result;
  }
  
    // Return [the, there, by, bye]
  public List<String> getWords()
  {
    List<String> words = new ArrayList<String>();
    
    if(root.isEnd())
    {
      
    }
    
    for(int index = 0;index < 26;index++)
    {
      
    }
    return words;
  }
  
  // Return [by, bye] when prefix = by
  public List<String> getWords(String prefix)
  {
    List<String> words = new ArrayList<String>();
    
    if(root.isEnd())
    {
      
    }
    
    for(int index = 0;index < 26;index++)
    {
      
    }
    return words;
  }
      
    
  
  public static void main(String[] args)
  {
    Solution trie = new Solution();
    trie.insert("the");
    trie.insert("there");
    trie.insert("by");
    trie.insert("bye");
    
    System.out.println(trie.search("thee"));
    System.out.println(trie.search("the"));
    System.out.println(trie.startsWith("by"));
    System.out.println(trie.search("by"));
    System.out.println(trie.wordCount(trie.root));
  }
}

class TrieNode
{
  public TrieNode[] links;
  private final int R = 26;
  private boolean isEnd;
  
  public TrieNode()
  {
    links = new TrieNode[R];
  }
  
  public boolean isEnd()
  {
    return isEnd;
  }
  
  public void setEnd()
  {
    this.isEnd = true;
  }
  
  public boolean containsKey(char value)
  {
    return links[value - 'a'] != null;
  }
  
  public void put(char value, TrieNode node)
  {
    links[value - 'a'] = node;
  }
  
  public TrieNode get(char value)
  {
    return links[value - 'a'];
  }
}

Any inputs would be helpful.

Thanks !