question: static List < File > tidyDatabaseList ( List < File > databaseFiles ) { Set < File > originalAsSet = new HashSet < File > ( databaseFiles ) ; List < File > tidiedList = new ArrayList < File > ( ) ; for ( File databaseFile : databaseFiles ) { String databaseFilename = databaseFile . getPath ( ) ; String sansSuffix = removeSuffix ( databaseFilename , UNINTERESTING_FILENAME_SUFFIXES ) ; if ( sansSuffix . equals ( databaseFilename ) || ! originalAsSet . contains ( new File ( sansSuffix ) ) ) { tidiedList . add ( databaseFile ) ; } } return tidiedList ; }
target:  Attempt to smartly eliminate uninteresting shadow databases such as -journal and -uid.  Note that this only removes the database if it is true that it shadows another database lacking the uninteresting suffix.