Complete the getMiddle method that gets the middle character from a word if the word length is odd, or the middle character pair if it is even. For example, getMiddle("Java") returns "av". If the word is empty, return the empty string. If it is null, return null.

Complete the following file:

Words.java

public class Words { /** Gets the middle character or character pair from this word when possible. @param word a word @return the middle character (if the word length is odd) or middle two characters (if it is even), or the empty string if the word is empty, or null if it is null. */ public String getMiddle(String word) { // your work here } }