Java - Write code to check if String array has Any Empty element

Requirements

Write code to check if String array has Any Empty element

Demo

//package com.book2s;

public class Main {
    public static void main(String[] argv) {
        String arr = "book2s.com";
        System.out.println(isAnyEmpty(arr));
    }//from w  ww. ja  va2  s . c o m

    public static boolean isAnyEmpty(String... arr) {
        for (String str : arr) {
            if (isEmpty(str)) {
                return true;
            }
        }
        return false;
    }

    public static boolean isEmpty(String raw) {
        if (null == raw || raw.trim().length() == 0
                || "null".equals(raw.trim())) {
            return true;
        }
        return false;
    }
}