Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.util.Collections;

import java.util.Map;

public class Main {
    public static <M extends Map> M wrapNullToImmutableEmptyMap(M map) {
        if (map != null) {
            return map;
        }
        return (M) Collections.EMPTY_MAP;
    }
}