NotificationChannelRegistryDataManager extends DataManager { @Nullable @WorkerThread public NotificationChannelCompat getChannel(@NonNull String channelId) { String where = COLUMN_NAME_CHANNEL_ID + " = ?"; Cursor cursor = query(TABLE_NAME, null, where, new String[]{channelId}, null); if (cursor == null) { return null; } cursor.moveToFirst(); NotificationChannelCompat channelCompat = null; if (!cursor.isAfterLast()) { channelCompat = getChannel(cursor); } cursor.close(); return channelCompat; } NotificationChannelRegistryDataManager(@NonNull Context context, @NonNull String appKey, @NonNull String dbName); @WorkerThread boolean createChannel(@NonNull NotificationChannelCompat channelCompat); @NonNull @WorkerThread Set<NotificationChannelCompat> getChannels(); @Nullable @WorkerThread NotificationChannelCompat getChannel(@NonNull String channelId); @WorkerThread boolean deleteChannel(@NonNull String channelId);  }
@Test public void testGetChannel() { dataManager.createChannel(channel1); Assert.assertEquals(channel1, dataManager.getChannel(channel1.getId())); }