Java tutorial
//package com.java2s; //Licensed under the Apache License, Version 2.0 (the "License"); import java.util.Collections; import java.util.Map; public class Main { public static <K, V> Map<K, V> nonNullMap(final Map<K, V> map) { if (map == null) { return Collections.emptyMap(); } return map; } }