Java tutorial
//package com.java2s; //License from project: Apache License import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; public class Main { public static Bundle maybeGetBundle(final @Nullable Bundle state, final @NonNull String key) { if (state == null) { return null; } return state.getBundle(key); } }