@RequiresApi(api = Build.VERSION_CODES.O)
  private static void createFtpChannel(Context context) {
    NotificationManager mNotificationManager =
        (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
    if (mNotificationManager.getNotificationChannel(CHANNEL_FTP_ID) == null) {
      NotificationChannel mChannel =
          new NotificationChannel(
              CHANNEL_FTP_ID,
              context.getString(R.string.channel_name_ftp),
              NotificationManager.IMPORTANCE_HIGH);
      // Configure the notification channel.
      mChannel.setDescription(context.getString(R.string.channel_description_ftp));
      mNotificationManager.createNotificationChannel(mChannel);
    }
  }
@Test
  @Config(sdk = {P}) // min sdk is O
  public void testCreateFtpChannel() {
    NotificationCompat.Builder builder = new NotificationCompat.Builder(context, CHANNEL_FTP_ID);
    NotificationConstants.setMetadata(context, builder, TYPE_FTP);
    List<Object> channels = shadowNotificationManager.getNotificationChannels();
    assertNotNull(channels);
    assertEquals(1, channels.size());
    NotificationChannel channel = (NotificationChannel) channels.get(0);
    assertEquals(IMPORTANCE_HIGH, channel.getImportance());
    assertEquals(CHANNEL_FTP_ID, channel.getId());
    assertEquals(context.getString(R.string.channel_name_ftp), channel.getName());
    assertEquals(context.getString(R.string.channel_description_ftp), channel.getDescription());
  }