Light version of patch (rebasing JDK8-based patch)
Adding back tests