@@ -43,7 +43,7 @@ public UniquePersonList() {}
4343 * Varargs/array constructor, enforces no nulls or duplicates.
4444 */
4545 public UniquePersonList (Person ... persons ) throws DuplicatePersonException {
46- CollectionUtil .assertNotNull ( persons );
46+ assert ! CollectionUtil .isAnyNull (( Object []) persons );
4747 final List <Person > initialPersons = Arrays .asList (persons );
4848 if (!CollectionUtil .elementsAreUnique (initialPersons )) {
4949 throw new DuplicatePersonException ();
@@ -97,7 +97,7 @@ public Set<Person> toSet() {
9797 * Returns true if the list contains an equivalent person as the given argument.
9898 */
9999 public boolean contains (ReadOnlyPerson toCheck ) {
100- CollectionUtil . assertNotNull ( toCheck ) ;
100+ assert toCheck != null ;
101101 return internalList .contains (toCheck );
102102 }
103103
@@ -107,7 +107,7 @@ public boolean contains(ReadOnlyPerson toCheck) {
107107 * @throws DuplicatePersonException if the person to add is a duplicate of an existing person in the list.
108108 */
109109 public void add (Person toAdd ) throws DuplicatePersonException {
110- CollectionUtil . assertNotNull ( toAdd ) ;
110+ assert toAdd != null ;
111111 if (contains (toAdd )) {
112112 throw new DuplicatePersonException ();
113113 }
@@ -120,7 +120,7 @@ public void add(Person toAdd) throws DuplicatePersonException {
120120 * @throws PersonNotFoundException if no such person could be found in the list.
121121 */
122122 public boolean remove (ReadOnlyPerson toRemove ) throws PersonNotFoundException {
123- CollectionUtil . assertNotNull ( toRemove ) ;
123+ assert toRemove != null ;
124124 final boolean personFoundAndDeleted = internalList .remove (toRemove );
125125 if (!personFoundAndDeleted ) {
126126 throw new PersonNotFoundException ();
0 commit comments