### Question:
Channel { public ContentValues toContentValues() { return toContentValues(false); } private  Channel(Builder builder); long getId(); String getPackageName(); String getInputId(); @Type String getType(); String getDisplayNumber(); String getDisplayName(); String getDescription(); @VideoFormat String getVideoFormat(); int getOriginalNetworkId(); int getTransportStreamId(); int getServiceId(); String getAppLinkText(); int getAppLinkColor(); Uri getAppLinkIconUri(); Uri getAppLinkPosterArtUri(); Uri getAppLinkIntentUri(); Intent getAppLinkIntent(); String getNetworkAffiliation(); boolean isSearchable(); byte[] getInternalProviderDataByteArray(); @ServiceType String getServiceType(); Long getInternalProviderFlag1(); Long getInternalProviderFlag2(); Long getInternalProviderFlag3(); Long getInternalProviderFlag4(); String getInternalProviderId(); boolean isTransient(); boolean isBrowsable(); @RestrictTo(LIBRARY_GROUP) boolean isSystemApproved(); int getConfigurationDisplayOrder(); String getSystemChannelKey(); boolean isLocked(); @Override int hashCode(); @Override boolean equals(Object other); @Override String toString(); ContentValues toContentValues(); @RestrictTo(LIBRARY_GROUP) ContentValues toContentValues(boolean includeProtectedFields); static Channel fromCursor(Cursor cursor); @RestrictTo(LIBRARY_GROUP)
    static final String[] PROJECTION; }### Answer:
@Test public void testChannelWithSystemContentProvider() { if (!Utils.hasTvInputFramework(InstrumentationRegistry.getContext())) { return; } Channel fullyPopulatedChannel = createFullyPopulatedChannel(); ContentValues contentValues = fullyPopulatedChannel.toContentValues(); ContentResolver resolver = InstrumentationRegistry.getContext().getContentResolver(); Uri channelUri = resolver.insert(Channels.CONTENT_URI, contentValues); assertNotNull(channelUri); Channel channelFromSystemDb = loadChannelFromContentProvider(resolver, channelUri); compareChannel(fullyPopulatedChannel, channelFromSystemDb, false); }
@Test public void testChannelUpdateWithContentProvider() { if (!Utils.hasTvInputFramework(InstrumentationRegistry.getContext())) { return; } Channel fullyPopulatedChannel = createFullyPopulatedChannel(); ContentValues contentValues = fullyPopulatedChannel.toContentValues(); ContentResolver resolver = InstrumentationRegistry.getContext().getContentResolver(); Uri channelUri = resolver.insert(Channels.CONTENT_URI, contentValues); assertNotNull(channelUri); Channel channelFromSystemDb = loadChannelFromContentProvider(resolver, channelUri); compareChannel(fullyPopulatedChannel, channelFromSystemDb, false); Channel updatedChannel = new Channel.Builder(channelFromSystemDb) .setDescription("new description").build(); assertEquals(1, resolver.update(channelUri, updatedChannel.toContentValues(), null, null)); channelFromSystemDb = loadChannelFromContentProvider(resolver, channelUri); compareChannel(updatedChannel, channelFromSystemDb, false); updatedChannel = new Channel.Builder(updatedChannel) .setAppLinkText(null).build(); assertEquals(1, resolver.update( channelUri, updatedChannel.toContentValues(), null, null)); channelFromSystemDb = loadChannelFromContentProvider(resolver, channelUri); compareChannel(updatedChannel, channelFromSystemDb, false); ContentValues values = new Channel.Builder().setDisplayName("abc").build() .toContentValues(); assertEquals(1, values.size()); assertEquals(1, resolver.update(channelUri, values, null, null)); channelFromSystemDb = loadChannelFromContentProvider(resolver, channelUri); Channel expectedChannel = new Channel.Builder(channelFromSystemDb) .setDisplayName("abc").build(); compareChannel(expectedChannel, channelFromSystemDb, false); }