Move methods that are used only in unit tests to TrashExt.