Summary
-------
Problem
-------
MethodHandleProxies.asInterfaceInstance does not support default methods and does not mention such methods with regards to selection of the uniquely named method.
Solution
--------
Refer to default methods with regards to selection of the uniquely named method.
Specification
-------------
diff -r 61f5673d6d02 src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java Tue Jul 10 12:22:07 2018 -0700
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java Wed Jul 11 11:05:36 2018 -0700
@@ -52,8 +54,10 @@
* A single-method interface is an interface which declares a uniquely named method.
* When determining the uniquely named method of a single-method interface,
* the public {@code Object} methods ({@code toString}, {@code equals}, {@code hashCode})
- * are disregarded. For example, {@link java.util.Comparator} is a single-method interface,
- * even though it re-declares the {@code Object.equals} method.
+ * are disregarded as are any default (non-abstract) methods.
+ * For example, {@link java.util.Comparator} is a single-method interface,
+ * even though it re-declares the {@code Object.equals} method and also
+ * declares default methods, such as {@code Comparator.reverse}.
* <p>
* The interface must be public. No additional access checks are performed.
* <p>