Java tutorial
//package com.java2s; public class Main { private static final String ERROR_MESSAGE = "packageName can't be null"; private static void ckeckNullPackageName(String packageName) { if (packageName == null || packageName.trim().length() == 0) throw new NullPointerException(ERROR_MESSAGE); } }