Library implements Parcelable { public boolean hasTelephone() { return getTelephone() != null && !getTelephone().isEmpty(); } Library(); protected  Library(Parcel in); String getDepartment(); String getEmail(); List<String> getAddress(); String getName(); @VisibleForTesting void setTestName(String name); String getCode(); @VisibleForTesting void setCode(String code); boolean isFacultyBib(); List<String> getTelephone(); boolean isActive(); String getThumbnail(); String getImage(); String getLatitude(); String getLongitude(); String getContact(); String getCampus(); String getFaculty(); String getLink(); String getCommentsAsString(); String getPhones(); @NonNull String getHeaderImage(Context context); @NonNull String addressAsString(); boolean hasTelephone(); @Override boolean equals(Object o); @Override int hashCode(); @Override int describeContents(); @Override void writeToParcel(Parcel dest, int flags); static final Creator<Library> CREATOR; }
@Test public void hasTelephone() { Library empty = new Library(); assertFalse(empty.hasTelephone()); Library full = generate(Library.class); assertTrue(full.hasTelephone()); }