I created a default empty project on Android Studio 2.1.2 with API 24. In the sample project, Google offers a depreciated class Applica
As indicated in the API documentation the API has been deprecated and instead use of the InstrumentationRegistry.getTargetContext() will in turn call onCreate method of your Application class.
The getTargetContext will call the ApplicationStartupService class defined in Android Manifest as below.
https://developer.android.com/reference/android/test/ApplicationTestCase