### Question:
TitleBuilder extends UpdateBuilder { public String build() { String title = ""; if(validNotificationsResponse() && validInboxResponse()) { title = resources.getQuantityString(R.plurals.message, inboxResponse.count, inboxResponse.count); title += " / "; title += resources.getQuantityString(R.plurals.notification, notificationResponse.count, notificationResponse.count); } else if(validNotificationsResponse()) { title = resources.getQuantityString(R.plurals.notification, notificationResponse.count, notificationResponse.count); } else if(validInboxResponse()) { title = resources.getQuantityString(R.plurals.message, inboxResponse.count, inboxResponse.count); } return title; } TitleBuilder(NotificationsResponse notificationsResponse, InboxResponse inboxResponse, Resources resources); String buildCondensed(); String build();  }### Answer:
@Test public void should_build_0_messages_0_notifications() { String title = "0 Messages / 0 Notifications"; InboxResponse inboxResponse = createInboxResponse(0); NotificationsResponse notificationsResponse = createNotificationResponse(0); TitleBuilder titleBuilder = new TitleBuilder(notificationsResponse, inboxResponse, resources); assertEquals(title, titleBuilder.build()); }
@Test public void should_build_2_messages_16_notificatons() { int messageCount = 2; int notificationCount = 16; String title = resources.getQuantityString(R.plurals.message, messageCount, messageCount); title += " / "; title += resources.getQuantityString(R.plurals.notification, notificationCount, notificationCount); TitleBuilder titleBuilder = new TitleBuilder(createNotificationResponse(16), createInboxResponse(2), resources); assertEquals(title, titleBuilder.build()); }
@Test public void should_build_2_messages() { int messageCount = 2; String title = resources.getQuantityString(R.plurals.message, messageCount, messageCount); TitleBuilder titleBuilder = new TitleBuilder(null, createInboxResponse(2), resources); assertEquals(title, titleBuilder.build()); titleBuilder = new TitleBuilder(createInvalidNotificationResponse(), createInboxResponse(2), resources); assertEquals(title, titleBuilder.build()); }
@Test public void should_build_16_notifications() { int notificationCount = 16; String title = resources.getQuantityString(R.plurals.notification, notificationCount, notificationCount); TitleBuilder titleBuilder = new TitleBuilder(createNotificationResponse(16), null, resources); assertEquals(title, titleBuilder.build()); titleBuilder = new TitleBuilder(createNotificationResponse(16), createInvalidInboxResponse(), resources); assertEquals(title, titleBuilder.build()); }