testLib/src/main/java/com/twofortyfouram/test/util/TestButlerUtil.java
public static boolean isTestButlerAvailable() {
        final PackageManager pm = InstrumentationRegistry.getContext().getPackageManager();
        try {
            // Expected to throw if TestButler is not installed.
            pm.getPackageInfo(TEST_BUTLER_PACKAGE_NAME, 0);
            return true;
        } catch (final PackageManager.NameNotFoundException e) {
            return false;
        }
    }
/**
     * @return True if TestButler is available.  This enables certain tests to disable themselves
     * on environments that don't support TestButler.
     */
@return True if TestButler is available.  This enables certain tests to disable themselves
on environments that don't support TestButler.
@return True if TestButler is available . This enables certain tests to disable themselves on environments that don ' t support TestButler .
public static boolean isTestButlerAvailable() {
        final PackageManager pm = InstrumentationRegistry.getContext().getPackageManager();
        try {
            pm.getPackageInfo(TEST_BUTLER_PACKAGE_NAME, 0);
            return true;
        } catch (final PackageManager.NameNotFoundException e) {
            return false;
        }
    }
public static boolean isTestButlerAvailable ( ) { final PackageManager pm = InstrumentationRegistry . getContext ( ) . getPackageManager ( ) ; try { pm . getPackageInfo ( TEST_BUTLER_PACKAGE_NAME , 0 ) ; return true ; } catch ( final PackageManager . NameNotFoundException e ) { return false ; } }
@return True if TestButler is available.
@return True if TestButler is available .
// Expected to throw if TestButler is not installed.