@Test public void combinerShouldModifyKey() { initPrefs("vehicle", "bicycle"); PrefMigrator.migrate(prefs, COMBINER_MODIFIER); assertPrefs("vehicle", "bicycle"); initPrefs("vehicle", "bicycle", "fast", true); PrefMigrator.migrate(prefs, COMBINER_MODIFIER); assertPrefs("vehicle", "fast_bicycle"); initPrefs("vehicle", "car"); PrefMigrator.migrate(prefs, COMBINER_MODIFIER); assertPrefs("vehicle", "car"); initPrefs("vehicle", "car", "fast", true); PrefMigrator.migrate(prefs, COMBINER_MODIFIER); assertPrefs("vehicle", "fast_car"); initPrefs("vehicle", "airplane", "fast", true); PrefMigrator.migrate(prefs, COMBINER_MODIFIER); assertPrefs("vehicle", "airplane", "fast", true); }
public static void migrate(SharedPreferences prefs, Migration... migrations) { for (Migration migration : migrations) { migration.apply(prefs); } }
PrefMigrator { public static void migrate(SharedPreferences prefs, Migration... migrations) { for (Migration migration : migrations) { migration.apply(prefs); } } }
PrefMigrator { public static void migrate(SharedPreferences prefs, Migration... migrations) { for (Migration migration : migrations) { migration.apply(prefs); } } private  PrefMigrator(); }
PrefMigrator { public static void migrate(SharedPreferences prefs, Migration... migrations) { for (Migration migration : migrations) { migration.apply(prefs); } } private  PrefMigrator(); static void migrate(SharedPreferences prefs, Migration... migrations); static void migrateSharedPrefs(); }
PrefMigrator { public static void migrate(SharedPreferences prefs, Migration... migrations) { for (Migration migration : migrations) { migration.apply(prefs); } } private  PrefMigrator(); static void migrate(SharedPreferences prefs, Migration... migrations); static void migrateSharedPrefs();  }