> For the complete documentation index, see [llms.txt](https://hanfak.gitbook.io/workspace/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hanfak.gitbook.io/workspace/general-paradigms/patterns/api/be-defensive-with-data.md).

# Be defensive with your data

* Make sure you deal with immutable return types
  * Make sure that the return type is not a mutable list, or the elements are mutable, thus preventing user from changing it
* use unmodifiable list, or copies
