If I have a reference to a class and invoke a method on it, and the class or the method is final, my understanding is that the compiler or the JVM would replace the dynamic dispatch with a cheaper static dispatch since it can determine exactly which version would be invoked.
However, what if I have a reference to an interface, and the interface currently has only a single implementor, and that implementor is final or the method is final in that implementor, can the JVM figure that out at runtime and optimize these calls?