Checkbox select and deselect in script

Checkbox select and deselect in script

Hi there,
I am writing a function that will check if a field is empty and in that case select a checkbox from another field. Looking like this:
  1. void checkMissingData()
  2. {
  3. for each Adult_Record in Register
  4. {
  5. if(Adult_Record.Date_of_Birth == null)
  6.   {
  7. if Adult_Record.Missing_Data.size() > 0
  8. {
  9. oldSelections = Adult_Record.Missing_Data;
  10. if (!oldSelections.contains("No DOB"))
  11. {
  12. oldSelections.add("No DOB");
  13.                 Adult_Record.Missing_Data = oldSelections;
  14. }
  15. }
  16. else
  17. {
  18. Adult_Record.Missing_Data = ("No DOB");
  19. }
  20.   }
  21. }
  22. }

So if the Date_of_Birth field is empty (null), then the Missing_Data field checkbox No DOB will be checked.

But now I want to add an ELSE statement for that first IF. In other words if the Date_of_Birth field is not empty then the checkbox "No DOB" should be unchecked. 

What is the opposite command of add in variable.add("value"); I tried remove but that's not it. And clear clears the whole field