### Question:
VActionMessageFactory extends AbstractMessageFactory { @Override public List<Message2Send> getMessage(MessageProcessUnit inUnit) { final SubscriptionSchedulingData theScheduling = inUnit.get(); final SubscriptionData theSubscription = theScheduling.getSubscription(); final Map<String, Object> theSettings = theSubscription.getSettings(); final FeedData feed = getFeed(theSubscription.getReference()); final VObject theRecipient = theSubscription.getObject().getReference(); final int theNbNews = Integer.parseInt(theSettings.get(VActionFreeHandler.NB_NEWS).toString()); final List<FeedItemData> itemsToSend; if (theScheduling.getType() == SCHEDULING_TYPE.InteractionTrigger) { itemsToSend = FeedItemData.findAllByFeed(feed, theNbNews); } else { FeedSubscriptionData feedSubscription = FeedSubscriptionData.findByObjectAndFeed(theSubscription.getObject(), feed); if ((feedSubscription == null) || !feedSubscription.isValid()) { feedSubscription = FeedSubscriptionData.create(feed, theSubscription.getObject(), theNbNews); } itemsToSend = FeedItemData.findUnreadForSubscription(feedSubscription, theNbNews); } if (!itemsToSend.isEmpty()) { final Files[] theBody = new Files[itemsToSend.size() + 1]; int i = 0; if (!theSettings.containsKey(VActionFullHandler.FILE)) { theBody[i++] = theSubscription.getApplication().getProfile().getFile().getReference(); } else { theBody[i++] = Factories.FILES.find(Long.parseLong(theSettings.get(VActionFullHandler.FILE).toString())); } for (final FeedItemData anItem : itemsToSend) { theBody[i++] = anItem.getContents().get(0); } final FeedItemData theLastKnownItem = itemsToSend.get(itemsToSend.size() - 1); final Service theService = feed.getType() == Feed.Type.PODCAST ? SERVICE.PODCAST.getService() : SERVICE.RSS.getService(); return Collections.singletonList((Message2Send) new VActionMessage2Send(inUnit.get(), theService, inUnit.getProcessConditioner()) { @Override protected boolean isStream() { return SERVICE.PODCAST.getService().equals(theService); } @Override protected String getTitle() { return VActionMessageFactory.buildTitle(getServiceLabel(), theLastKnownItem.getTitle()); } @Override protected MessageSignature getSignature() { return new MessageSignature(theService); } @Override protected Files[] getBody() { return theBody; } @Override public void runWhenSent() { final FeedSubscriptionData subscription = FeedSubscriptionData.findByObjectAndFeed(VObjectData.getData(theRecipient), feed); if (subscription != null) { subscription.setLastReadItem(theLastKnownItem); } } }); } return Collections.emptyList(); }  @Override List<Message2Send> getMessage(MessageProcessUnit inUnit);  }### Answer:
@Test public void getMessageWithNoNewContents() { init(); final int nbNews = 3; final Feed theFeed = Factories.FEED.findByUrlAndType("http: final FeedSubscription sub = Factories.FEED_SUBSCRIPTION.create(theFeed, getKowalskyObject(), 0); Assert.assertEquals("title29", sub.getLastReadItem().getTitle()); final Subscription theSubscription = new SubscriptionMock(1, Factories.APPLICATION.findByName("net.violet.rss.cbbc_newsround"), getKowalskyObject()); final Map<String, Object> settings = new HashMap<String, Object>(); settings.put(VActionFreeHandler.NB_NEWS, Integer.toString(nbNews)); theSubscription.setSettings(settings); final VActionMessageFactory theFactory = (VActionMessageFactory) AbstractMessageFactory.getFactoryByApplication(theSubscription.getApplication()); final SubscriptionSchedulingData scheduling = SubscriptionSchedulingData.create(SubscriptionData.getData(theSubscription), SchedulingType.SCHEDULING_TYPE.Ambiant); final List<Message2Send> theMessage = theFactory.getMessage(new MessageProcessUnit(scheduling, null, null) { @Override public void runWhenSuccessful() { } }); Assert.assertTrue(theMessage.isEmpty()); }