### Question:
FileProvider extends ContentProvider { public static Uri getUriForFile(@NonNull Context context, @NonNull String authority, @NonNull File file) { final PathStrategy strategy = getPathStrategy(context, authority); return strategy.getUriForFile(file); }  @Override boolean onCreate(); @Override void attachInfo(@NonNull Context context, @NonNull ProviderInfo info); static Uri getUriForFile(@NonNull Context context, @NonNull String authority,
            @NonNull File file); @Override Cursor query(@NonNull Uri uri, @Nullable String[] projection, @Nullable String selection,
            @Nullable String[] selectionArgs,
            @Nullable String sortOrder); @Override String getType(@NonNull Uri uri); @Override Uri insert(@NonNull Uri uri, ContentValues values); @Override int update(@NonNull Uri uri, ContentValues values, @Nullable String selection,
            @Nullable String[] selectionArgs); @Override int delete(@NonNull Uri uri, @Nullable String selection,
            @Nullable String[] selectionArgs); @Override ParcelFileDescriptor openFile(@NonNull Uri uri, @NonNull String mode);  }### Answer:
@Test public void testStrategyExtraSeparators() throws Exception { final SimplePathStrategy strat = new SimplePathStrategy("authority"); strat.addRoot("tag", mContext.getFilesDir()); File inFile = new File(mContext.getFilesDir(), " File expectedRoot = mContext.getFilesDir().getCanonicalFile(); File outFile = new File(expectedRoot, "/foo/bar"); final String expected = "content: assertEquals(expected, strat.getUriForFile(inFile).toString()); assertEquals(outFile.getPath(), strat.getFileForUri(Uri.parse(expected)).getPath()); }