My point was, clientConnectionManagers.remove uses ClientConnectionManager#equals and we don't know how that method is implemented for all ClientConnectionManager we'll have to work with. Depending on ClientConnectionManager#equals implementation the code above may be removing wrong connection manager from the list, it removes first equal instance found, IIRC, which may not be the instance we want to remove.