App implements Parcelable, Comparable<App> { public boolean matches(String filter) { return filter != null && title.contains(filter); } App(String title); private  App(Parcel in); boolean matches(String filter); @Override int compareTo(App app); @Override boolean equals(Object o); @Override int hashCode(); @Override int describeContents(); @Override void writeToParcel(Parcel dest, int flags); final String title; static final Creator<App> CREATOR; }
@Test public void should_match() { App app = new App("MyTitle"); boolean result = app.matches("My"); assertThat(result).isTrue(); }
@Test public void should_not_match() { App app = new App("MyTitle"); boolean result = app.matches("My"); assertThat(result).isTrue(); }
@Test public void should_not_match_null() { App app = new App("MyTitle"); boolean result = app.matches(null); assertThat(result).isFalse(); }
@Test public void should_not_match_null_empty() { App app = new App("MyTitle"); boolean result = app.matches(""); assertThat(result).isTrue(); }