This code pattern:

    x.function1(optional_args1);
    if (x instanceof DerivedClass) {
        DerivedClass dc = (DerivedClass) x;
        dc.function2(optional_args2);
    }


always makes me want to refactor:

    x.function1maybe2(optional_args1, optional_args2);

Yes, it's just a little ugly to pass the extra args2 for the class where they are not needed.
But I think it's more ugly to require the caller to know about the derived class.