The whole module shouldn’t need to be Java8 compatible, just the test code. And Java8 bytecode should be supported for any SDK version, using Build Tools 3.0.0 (more than a year)
https://developer.android.com/studio/write/java8-support, and limited support was available long before that with the Jack compiler.