### Question:
AlertsService { public int getMonthlyStockCountDay() { return sharedPreferences.getInt(CommodityService.MONTHLY_STOCK_COUNT_DAY, 24); }  List<LowStockAlert> getLowStockAlerts(); List<LowStockAlert> getEnabledLowStockAlerts(); int numberOfAlerts(); int getNumberOfRoutineOrderAlerts(); List<LowStockAlert> getTop5LowStockAlerts(); void updateLowStockAlerts(); void updateCommodityLowStockAlert(Commodity commodity); void updateCache(); void disableAlertsForCommodities(List<Commodity> commodities); void disableAllRoutineOrderAlerts(); ImmutableList<LowStockAlert> getLowStockAlertsForCommodities(final List<Commodity> commodities); void createAlert(final LowStockAlert lowStockAlert); void disableLowStockAlert(LowStockAlert alert); void deleteLowStockAlert(final LowStockAlert alert); void updateLowStockAlert(final LowStockAlert lowStockAlert); List<OrderCommodityViewModel> getOrderCommodityViewModelsForLowStockAlert(); int getRoutineOrderAlertDay(); void generateRoutineOrderAlert(Date date); List<? extends NotificationMessage> getNotificationMessagesForHomePage(); List<? extends NotificationMessage> getNotificationMessages(); List<MonthlyStockCountAlert> getEnabledMonthlyStockAlerts(); List<OrderCommodityViewModel> getOrderViewModelsForRoutineOrderAlert(); void generateAllocationAlerts(); List<AllocationAlert> getAllocationAlerts(); void deleteAllocationAlert(final Allocation allocation); void generateMonthlyStockCountAlerts(Date date); int getMonthlyStockCountDay(); List<MonthlyStockCountAlert> getMonthlyStockCountAlerts(final Date date); void disableAllMonthlyStockCountAlerts(); static final String DISABLED; static SimpleDateFormat ALERT_DATE_FORMAT; }### Answer:
@Test public void shouldGetStockCountDayFromPreferences() throws Exception { Integer day = 23; setPreferenceIntegerValue(day, CommodityService.MONTHLY_STOCK_COUNT_DAY); assertThat(alertsService.getMonthlyStockCountDay(), is(day)); }