Java tutorial
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import static com.google.common.collect.Iterables.isEmpty; import java.util.Map; import javax.annotation.Nullable; public class Main { /** Checks if an iterable is null or empty. */ public static boolean isNullOrEmpty(@Nullable Iterable<?> potentiallyNull) { return potentiallyNull == null || isEmpty(potentiallyNull); } /** Checks if a map is null or empty. */ public static boolean isNullOrEmpty(@Nullable Map<?, ?> potentiallyNull) { return potentiallyNull == null || potentiallyNull.isEmpty(); } }