You could, but you would need to know the type in order to actually call the method (in the absence of reflection, etc.) if it does not match the type that you are passing.
Types determine what is known at compile time: if CoffeeDecorater does not include the fatContent signature, nothing receiving CoffeeDecoractor knows which method exists.
You can create an additional interface, but you need to either know that it exists so that you can verify it ( instanceof ), or interrogate the class to verify the specific signature (reflection).
Java either knows that the method exists at compile time, or checks it at run time.
source share