### Question:
ContextCompat { @Nullable public static String getSystemServiceName(@NonNull Context context, @NonNull Class<?> serviceClass) { if (Build.VERSION.SDK_INT >= 23) { return context.getSystemServiceName(serviceClass); } return LegacyServiceMapHolder.SERVICES.get(serviceClass); } protected  ContextCompat(); static boolean startActivities(@NonNull Context context, @NonNull Intent[] intents); static boolean startActivities(@NonNull Context context, @NonNull Intent[] intents,
            @Nullable Bundle options); static void startActivity(@NonNull Context context, @NonNull Intent intent,
            @Nullable Bundle options); @Nullable static File getDataDir(@NonNull Context context); @NonNull static File[] getObbDirs(@NonNull Context context); @NonNull static File[] getExternalFilesDirs(@NonNull Context context, @Nullable String type); @NonNull static File[] getExternalCacheDirs(@NonNull Context context); @Nullable static Drawable getDrawable(@NonNull Context context, @DrawableRes int id); @Nullable static ColorStateList getColorStateList(@NonNull Context context,
            @ColorRes int id); @ColorInt static int getColor(@NonNull Context context, @ColorRes int id); static int checkSelfPermission(@NonNull Context context, @NonNull String permission); @Nullable static File getNoBackupFilesDir(@NonNull Context context); static File getCodeCacheDir(@NonNull Context context); @Nullable static Context createDeviceProtectedStorageContext(@NonNull Context context); static boolean isDeviceProtectedStorage(@NonNull Context context); static void startForegroundService(@NonNull Context context, @NonNull Intent intent); @SuppressWarnings("unchecked") @Nullable static T getSystemService(@NonNull Context context, @NonNull Class<T> serviceClass); @Nullable static String getSystemServiceName(@NonNull Context context,
            @NonNull Class<?> serviceClass);  }### Answer:
@Test public void getSystemServiceName() { String serviceName = ContextCompat.getSystemServiceName(mContext, LayoutInflater.class); assertEquals(LAYOUT_INFLATER_SERVICE, serviceName); }
@Test public void getSystemServiceNameUnknown() { assertNull(ContextCompat.getSystemServiceName(mContext, String.class)); }
@Test @SdkSuppress(minSdkVersion = 23) public void getSystemServiceNameCallsRealMethodOn23() { final AtomicBoolean called = new AtomicBoolean(); Context c = new ContextWrapper(mContext) { @Override public String getSystemServiceName(Class<?> serviceClass) { called.set(true); return super.getSystemServiceName(serviceClass); } }; String serviceName = ContextCompat.getSystemServiceName(c, LayoutInflater.class); assertEquals(LAYOUT_INFLATER_SERVICE, serviceName); assertTrue(called.get()); }