Multi-module Unit Test Support with Gradle

When writing tests for multi-module projects there may be some test helper classes or base test classes that you want to use in more than one module. One way to do this is to create a separate project for the re-usable test classes. The disadvantage is that the test code is separated from the source code and tests may not be executed or maintained. This post describes an easy way to create and use test classes for Android projects using Gradle and Android studio without having to create a separate project for the test classes.