class Printer {

    static String format(Object e, Formatter formatter) {
        if (formatter != null) {
            return formatter.format(e);
        }
        if (e instanceof Object[]) {
            return Arrays.toString((Object[]) e);
        }
        return String.valueOf(e);
    }

    private  Printer();

}