Java - Write code to create a function to check if a string is Empty

Requirements

Write code to create a function to check if a string is Empty

Demo

//package com.book2s;

public class Main {
    public static void main(String[] argv) {
        String string = "book2s.com";
        System.out.println(isEmpty(string));
    }/*from  w  ww.  ja va  2s  .  com*/

    public static boolean isEmpty(final String string) {
        if (string == null) {
            return true;
        }
        return string.trim().length() == 0;
    }
}