/**
  * @inheritdoc
  */
 public function remove(User $user)
 {
     if (!$this->collection->containsKey((string) $user->getId())) {
         throw new UserNotFoundException();
     }
     return $this->collection->removeElement($user);
 }
 public function testJsonSerialize()
 {
     $user = new User($this->uuid, $this->username, $this->email, $this->password);
     $expected = ['id' => (string) $this->uuid, 'username' => 'username', 'email' => '*****@*****.**'];
     $this->assertEquals($expected, $user->jsonSerialize());
 }