public void fillPosition(String title, Person hire) { for (Position position : this) if (position.getTitle().equals(title) && position.getPerson() == Person.NULL) { position.setPerson(hire); return; } throw new RuntimeException("Position " + title + " not available"); }
public boolean positionAvailable(String title) { for (Position position : this) if (position.getTitle().equals(title) && position.getPerson() == Person.NULL) return true; return false; }