HasMany extends Relationship<List<T>> implements Iterable<ResourceIdentifier>, Serializable { public boolean hasData() { return this.hasData; } HasMany();  HasMany(ResourceIdentifier... resources); @Override List<T> get(Document document); List<T> get(Document document, T defaultValue); ResourceIdentifier get(int position); List<ResourceIdentifier> get(); @Override Iterator<ResourceIdentifier> iterator(); boolean add(ResourceIdentifier identifier); boolean add(String type, String id); boolean remove(ResourceIdentifier identifier); boolean remove(String type, String id); int size(); boolean hasData(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void deserialization() throws Exception { HasMany hasMany = TestUtil.moshi().adapter(HasMany.class) .fromJson("{\"data\":[{\"type\":\"comments\",\"id\":\"0\"},{\"type\":\"comments\",\"id\":\"1\"}]}"); assertThat(hasMany, equalTo((HasMany) comments(2))); assertTrue(hasMany.hasData()); assertFalse(TestUtil.moshi().adapter(HasMany.class).fromJson("{\"data\":null}").hasData()); }