So we know that Java 8 method references can be used to replace anonymous class creation. I'm curious if there's a way to use them to define named classes that implement a functional interface, something -- vaguely -- along the lines of
public interface Bar {
String returnSomeString();
}
public class Foo implements Bar = someObjectInstance::toString;
I know you can't use equals in defining a class, but something like that...