LPS-46155 Avoid adding duplicate class name to the list. Use contains check to replace clear()