Java tutorial
//package com.java2s; /******************************************************************************* * Copyright (c) 2005, 2014 springside.github.io * * Licensed under the Apache License, Version 2.0 (the "License"); *******************************************************************************/ import java.util.Collection; import java.util.Map; public class Main { @SuppressWarnings("rawtypes") public static boolean isEmpty(Collection collection) { return (collection == null) || collection.isEmpty(); } @SuppressWarnings("rawtypes") public static boolean isEmpty(Map map) { return (map == null) || map.isEmpty(); } }