MergingException extends Exception { @NonNull public List<Message> getMessages() { return mMessages; } protected  MergingException(@Nullable Throwable cause, @NonNull Message... messages); static Builder wrapException(@NonNull Throwable cause); static Builder withMessage(@NonNull String message, Object... args); static void throwIfNonEmpty(Collection<Message> messages); @NonNull List<Message> getMessages(); @NonNull @Override String getMessage(); @Override String toString(); static final String MULTIPLE_ERRORS; static final String RESOURCE_ASSET_MERGER_TOOL_NAME; }
@Test public void testConsumerExceptionWithNullMessage() { MergingException exception = new MergeConsumer.ConsumerException(new IOException()); Message message = Iterables.getOnlyElement(exception.getMessages()); assertNotNull(message.getText()); assertNotNull(message.getRawMessage()); }