code: public static String nullIfEmpty(String s) {
        if (s != null && s.length() == 0) {
           return null;
        } else {
           return s;
        }
     }
docs: Returns null if the parameter is null or empty, otherwise it returns it untouched