If you cannot touch the interface, then your only choice is to throw a RuntimeException . There are several standard RuntimeExceptions that you can use directly: IllegalStateException , IllegalArgumentException , UsupportedOperationException , etc.
Use these standard exceptions if they suit your needs, or create your own by extending the RuntimeException class. Consider documenting thrown exceptions using @throws in javadoc.
source share