Added methods at PreferencesUtils and create a unit test class.