private constructors that prevent instantiation of utility classes that only contain static methods; e.g.
throw new UnsupportedOperationException() for unimplemented, never-called methods in non-public classes required only to implement an interface; Example: ChildIterator
throw new RuntimeException() in catch blocks for exceptions that "can't happen" in a correctly functioning VM; e.g. catch UnsupportedEncodingException for the UTF-8 encoding; Example:
fail() statements when testing for exceptions to be thrown
platform or VM-specific code; especially code for platform specific bugs or workarounds
I checked with JUnit 4 and noticed that it doesn't call System.exit(), so that's something we need to fix.--Kent Beck on the junit mailing list, October 12, 2005