### Question:
WhatsAppMessage implements Comparable<WhatsAppMessage> { public boolean hasText() { return !TextUtils.isEmpty(data); } WhatsAppMessage();  WhatsAppMessage(Cursor c); long getId(); boolean isReceived(); Date getTimestamp(); String getText(); String getFilteredText(); int getStatus(); double getLongitude(); double getLatitude(); int getRecipientCount(); String getNumber(); Media getMedia(); Receipt getReceipt(); boolean hasMediaAttached(); boolean hasText(); @Override String toString(); @Override int compareTo(WhatsAppMessage another); boolean isDirectMessage(); boolean isGroupMessage(); static final String TABLE; static final String GROUP; static final String DIRECT; }### Answer:
@Test public void shouldHaveTextIfNonEmptyString() throws Exception { WhatsAppMessage m = new WhatsAppMessage(); assertThat(m.hasText()).isFalse(); m.data = ""; assertThat(m.hasText()).isFalse(); m.data = "some text"; assertThat(m.hasText()).isTrue(); }