### Question:
NotificationIds { public static int getNewMailStackedNotificationId(Account account, int index) { if (index < 0 || index >= NUMBER_OF_STACKED_NOTIFICATIONS) { throw new IndexOutOfBoundsException("Invalid value: " + index); } return getBaseNotificationId(account) + OFFSET_NEW_MAIL_STACKED + index; }  static int getNewMailSummaryNotificationId(Account account); static int getNewMailStackedNotificationId(Account account, int index); static int getFetchingMailNotificationId(Account account); static int getSendFailedNotificationId(Account account); static int getCertificateErrorNotificationId(Account account, boolean incoming); static int getAuthenticationErrorNotificationId(Account account, boolean incoming);  }### Answer:
@Test public void getNewMailStackedNotificationId_withDefaultAccount() throws Exception { Account account = createMockAccountWithAccountNumber(0); int notificationIndex = 0; int notificationId = NotificationIds.getNewMailStackedNotificationId(account, notificationIndex); assertEquals(7, notificationId); }
@Test(expected = IndexOutOfBoundsException.class) public void getNewMailStackedNotificationId_withTooLowIndex() throws Exception { Account account = createMockAccountWithAccountNumber(0); NotificationIds.getNewMailStackedNotificationId(account, -1); }
@Test(expected = IndexOutOfBoundsException.class) public void getNewMailStackedNotificationId_withTooLargeIndex() throws Exception { Account account = createMockAccountWithAccountNumber(0); NotificationIds.getNewMailStackedNotificationId(account, 8); }
@Test public void getNewMailStackedNotificationId_withSecondAccount() throws Exception { Account account = createMockAccountWithAccountNumber(1); int notificationIndex = 7; int notificationId = NotificationIds.getNewMailStackedNotificationId(account, notificationIndex); assertEquals(29, notificationId); }