Java tutorial
//package com.java2s; //License from project: Creative Commons License public class Main { /** * Runs a Runnable if it is not null. Avoids those annoying null checks everywhere. * * @param callback * The Runnable to run. */ public static void runCallback(final Runnable callback) { if (callback != null) { callback.run(); } } }