My problem is as follows:

We have an Algorithm that works internally with 

* Expression-objects that have a "String getContent()" method
* Manipulator-objects that manipulate on Expressions using the "Expression manipulate(Expression e)" method

This will become a framework in Java.
To solve a real problem, one needs to give a specific implementation 
of both an Expression and a Manipulator and the Algorithm class will do the rest.

Let's say we need a ProblemExpression and a ProblemManipulator
for a specific problem.

The ProblemExpression may contain a lot of new fields,
which can be used by the ProblemManipulator.

Right now, I can only think of two ways to write clean code:

* Let ProblemManipulator.manipulate assume its arguments are ProblemExpressions
* Use instanceOf

But I've got the feeling this is not how I *should* do it.
Any other suggestions?

Regards and thank you in advance,

Xaero.