Skip to content

Instantly share code, notes, and snippets.

@abner-math
Created February 1, 2020 16:52
Show Gist options
  • Save abner-math/3487f34c79276b9efcefd095ef4b504b to your computer and use it in GitHub Desktop.
Save abner-math/3487f34c79276b9efcefd095ef4b504b to your computer and use it in GitHub Desktop.
import java.util.Collections;
public class System {
private Set<User> users;
public Set<User> getUsers() {
return Collections.unmodifiableSet(this.users);
}
public boolean addUser(String login, String password) {
return this.users.add(new User(login, password));
}
public boolean removeUser(User user) {
return this.users.remove(user);
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment