@Test public void testDefensiveCopyOfResultList() { List<Object> data = new ArrayList<>(); data.add("entry1"); PagingResult<Object> result = new PagingResult<>(data, null, null); data.add("entry2"); assertThat(result.getResult()).containsOnly("entry1"); }
public List<T> getResult() { return result; }
PagingResult { public List<T> getResult() { return result; } }
PagingResult { public List<T> getResult() { return result; } PagingResult(Collection<? extends T> result, Paging paging, PagingLinkObjects pagingLinkObjects); }
PagingResult { public List<T> getResult() { return result; } PagingResult(Collection<? extends T> result, Paging paging, PagingLinkObjects pagingLinkObjects); List<T> getResult(); Paging getPaging(); PagingLinkObjects getPagingLinkObjects(); @Override boolean equals(Object o); @Override int hashCode(); }
PagingResult { public List<T> getResult() { return result; } PagingResult(Collection<? extends T> result, Paging paging, PagingLinkObjects pagingLinkObjects); List<T> getResult(); Paging getPaging(); PagingLinkObjects getPagingLinkObjects(); @Override boolean equals(Object o); @Override int hashCode();  }