} else if (obj instanceof Long) { return format(((Long) obj).longValue(), toAppendTo);
    public StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos) {        if (obj instanceof Date) {            return format((Date) obj, toAppendTo);        } else if (obj instanceof Calendar) {            return format((Calendar) obj, toAppendTo);        } else {            throw new IllegalArgumentException("Unknown class: " +                (obj == null ? "<null>" : obj.getClass().getName()));        }    }