UrbanAirshipProvider extends ContentProvider { @NonNull @Override public String getType(@NonNull Uri uri) { int type = matcher.match(uri); switch (type) { case RICHPUSH_MESSAGES_URI_TYPE: return RICH_PUSH_CONTENT_TYPE; case RICHPUSH_MESSAGE_URI_TYPE: return RICH_PUSH_CONTENT_ITEM_TYPE; case PREFERENCES_URI_TYPE: return PREFERENCES_CONTENT_TYPE; case PREFERENCE_URI_TYPE: return PREFERENCES_CONTENT_ITEM_TYPE; case EVENT_URI_TYPE: return EVENTS_CONTENT_TYPE; case EVENTS_URI_TYPE: return EVENTS_CONTENT_ITEM_TYPE; } throw new IllegalArgumentException("Invalid Uri: " + uri); }  @NonNull static Uri getRichPushContentUri(@NonNull Context context); @NonNull static Uri getPreferencesContentUri(@NonNull Context context); @NonNull static Uri getEventsContentUri(@NonNull Context context); @NonNull static String getAuthorityString(@NonNull Context context); @Override boolean onCreate(); @Override int delete(@NonNull Uri uri, @Nullable String selection, @Nullable String[] selectionArgs); @NonNull @Override String getType(@NonNull Uri uri); @Override int bulkInsert(@NonNull Uri uri, @NonNull ContentValues[] values); @Override @Nullable Uri insert(@NonNull Uri uri, @Nullable ContentValues values); @Override @Nullable Cursor query(@NonNull Uri uri, @Nullable String[] projection, @Nullable String selection, @Nullable String[] selectionArgs, @Nullable String sortOrder); @Override int update(@NonNull Uri uri, @Nullable ContentValues values, @Nullable String selection, @Nullable String[] selectionArgs); @Override void shutdown(); @NonNull
    static final String QUERY_PARAMETER_LIMIT; }
@Test @Config(shadows = { CustomShadowContentResolver.class }) public void testGetType() { Uri messagesUri = this.richPushUri; assertEquals(UrbanAirshipProvider.RICH_PUSH_CONTENT_TYPE, this.resolver.getType(messagesUri)); Uri messageUri = Uri.withAppendedPath(this.richPushUri, "this.should.work"); assertEquals(UrbanAirshipProvider.RICH_PUSH_CONTENT_ITEM_TYPE, this.resolver.getType(messageUri)); Uri failureUri = Uri.parse("content: assertNull(this.resolver.getType(failureUri)); }