We can create a read-only collection using Collections.unmodifiableCollection(Collection c) method before passing it as argument, this will make sure that any operation to change the collection will throw UnsupportedOperationException.
There is a possibility on one controller multiple people are working and all of them have login credentials of controller node. Assume someone is editing one playbook but he/she does not let others to see the changes. Is there any way in Ansible by which a user can stop others to edit/read the file ?