SortHelper { public Sort getSortByPreference() { String sort = sharedPreferences.getString( PREF_SORT_BY_KEY, PREF_SORT_BY_DEFAULT_VALUE ); return Sort.fromString(sort); } @Inject  SortHelper(SharedPreferences sharedPreferences); Sort getSortByPreference(); Uri getSortedMoviesUri(); boolean saveSortByPreference(Sort sort);  }
@Test public void testGetSortByPreference() throws Exception { sort = Sort.MOST_POPULAR; mockSortHelper = createMockSharedPreference(); assertEquals(sort, mockSortHelper.getSortByPreference()); }