@Test
public void onServicesDiscoveredCharacteristicNotifyTest() throws Exception {

    BluetoothGattCallback callback = connectAndGetCallback();
    BluetoothGattService service = mock(BluetoothGattService.class);
    when(service.getUuid()).thenReturn(SERVICE_UUID);
    when(gatt.getServices()).thenReturn(Arrays.asList(service));
    BluetoothGattCharacteristic characteristic = mock(BluetoothGattCharacteristic.class);
    when(characteristic.getProperties()).thenReturn(PROPERTY_NOTIFY);
    when(service.getCharacteristics()).thenReturn(Arrays.asList(characteristic));
    callback.onServicesDiscovered(gatt, 0);
    List<UUID> expected = Arrays.asList(SERVICE_UUID);
      assertThat(peripheral.getServices(), is(expected));
}