BluetoothManager { public boolean isBluetoothSupported() { return (mBluetoothAdapter != null); } private  BluetoothManager(Context context); private  BluetoothManager(Context context, BluetoothAdapter bluetoothAdapter,
                             SharedPreferences sharedPreferences); static BluetoothManager getInstance(Context context); static BluetoothManager getInstance(Context context, BluetoothAdapter bluetoothAdapter,
                                               SharedPreferences sharedPreferences); synchronized boolean bind(BluetoothManagerListener listener); synchronized void release(BluetoothManagerListener listener); boolean isBluetoothSupported(); boolean isBleSupported(); @TargetApi(21) FeatureSupportedStatus isBleMultipleAdvertisementSupported(); @TargetApi(21) FeatureSupportedStatus isBleOffloadedScanBatchingSupported(); @TargetApi(21) FeatureSupportedStatus isBleOffloadedFilteringSupported(); boolean isBluetoothEnabled(); boolean setBluetoothEnabled(boolean enable); BluetoothAdapter getBluetoothAdapter(); String getBluetoothMacAddress(); String getBluetoothName(); BluetoothDevice getRemoteDevice(String address);  }
@Test public void testIsBluetoothSupported_notSupported() throws Exception { Field mBluetoothAdapterField = mBluetoothManager.getClass().getDeclaredField("mBluetoothAdapter"); mBluetoothAdapterField.setAccessible(true); mBluetoothAdapterField.set(mBluetoothManager, null); assertThat("should be false as the device doesn't have Bluetooth support", mBluetoothManager.isBluetoothSupported(), is(false)); }
@Test public void testIsBluetoothSupported_supported() throws Exception { assertThat("should be false as the device has Bluetooth support", mBluetoothManager.isBluetoothSupported(), is(true)); }