There's this evil bit of the JDK involving NIO, where deep in the inner loop of a per-byte copy there's a virtual call:
ByteBuffer bb = ...;
for( int i=0; i<N; i++ )
buf[i] = bb.get(i);
No problemo, the JIT will inline the single target, right?
Suppose the abstract class ByteBuffer has a single implementing class called DirectByteBuffer (via the abstract class MappedByteBuffer).
Then the JVM can prove that any ByteBuffer must be an instance of a DirectByteBuffer (please pardon my not-quite-exact translation to java-pseudo-code):