Using construct like "streamSupplier.get()::spliterator" in a lambda expression leads to
Exception in thread "main" java.lang.IllegalAccessError: tried to access class java.util.stream.BaseStream from class IllegalAccessErrorTest$AllTests
at IllegalAccessErrorTest$AllTests.lambda$2$bridge(IllegalAccessErrorTest.java:25)
at IllegalAccessErrorTest$AllTests$$Lambda$3.get(Unknown Source)
If method reference is not used no exception is thrown.
Please see the source attached for reproduction of the issue.
It definitely could be simplified as it has a trace of JCK's test frameworks.
The problem could be seen on both JDK8b94 and JDK8b95-lambda.
Plenty of JCK tests fail due to this issue, currently a "use-lambda-not-methodref" workaround is applied in the tests.
Please redispatch this issue to compiler or VM as needed.