I prefer to throw Java standard subclass of RuntimeException
. This gives the flexibility of allowing the Exception to propagate or be caught without having references to your API.
There are many subclasses to choose from http://docs.oracle.com/javase/7/docs/api/java/lang/RuntimeException.html
Often I use IllegalStateException
or IllegalArgumentException