@Test(expected = UnsupportedOperationException.class) public void testGetDeviceException() { Neatle.getDevice("no:ta:ma:c!"); }
public static BluetoothDevice getDevice(@NonNull String mac) { String upperMac = mac.toUpperCase(); if (isMacValid(upperMac)) { return BluetoothAdapter.getDefaultAdapter().getRemoteDevice(upperMac); } throw new UnsupportedOperationException("Device mac not recognized."); }
Neatle { public static BluetoothDevice getDevice(@NonNull String mac) { String upperMac = mac.toUpperCase(); if (isMacValid(upperMac)) { return BluetoothAdapter.getDefaultAdapter().getRemoteDevice(upperMac); } throw new UnsupportedOperationException("Device mac not recognized."); } }
Neatle { public static BluetoothDevice getDevice(@NonNull String mac) { String upperMac = mac.toUpperCase(); if (isMacValid(upperMac)) { return BluetoothAdapter.getDefaultAdapter().getRemoteDevice(upperMac); } throw new UnsupportedOperationException("Device mac not recognized."); } private  Neatle(); }
Neatle { public static BluetoothDevice getDevice(@NonNull String mac) { String upperMac = mac.toUpperCase(); if (isMacValid(upperMac)) { return BluetoothAdapter.getDefaultAdapter().getRemoteDevice(upperMac); } throw new UnsupportedOperationException("Device mac not recognized."); } private  Neatle(); static CharacteristicSubscription createSubscription(@NonNull Context context, @NonNull BluetoothDevice device,
                                                                @NonNull UUID serviceUUID, @NonNull UUID characteristicsUUID); static ConnectionMonitor createConnectionMonitor(@NonNull Context context, @NonNull BluetoothDevice device); static OperationBuilder createOperationBuilder(@NonNull Context context); static UUID createUUID(int uuid); static Connection getConnection(@NonNull Context context, @NonNull BluetoothDevice device); static boolean isMacValid(@NonNull String mac); static BluetoothDevice getDevice(@NonNull String mac); static ScanBuilder createScannerBuilder(); }
Neatle { public static BluetoothDevice getDevice(@NonNull String mac) { String upperMac = mac.toUpperCase(); if (isMacValid(upperMac)) { return BluetoothAdapter.getDefaultAdapter().getRemoteDevice(upperMac); } throw new UnsupportedOperationException("Device mac not recognized."); } private  Neatle(); static CharacteristicSubscription createSubscription(@NonNull Context context, @NonNull BluetoothDevice device,
                                                                @NonNull UUID serviceUUID, @NonNull UUID characteristicsUUID); static ConnectionMonitor createConnectionMonitor(@NonNull Context context, @NonNull BluetoothDevice device); static OperationBuilder createOperationBuilder(@NonNull Context context); static UUID createUUID(int uuid); static Connection getConnection(@NonNull Context context, @NonNull BluetoothDevice device); static boolean isMacValid(@NonNull String mac); static BluetoothDevice getDevice(@NonNull String mac); static ScanBuilder createScannerBuilder();  }