protected List<String> toNames(Iterable<Programmer> programmers) { List<String> names = new ArrayList<>(); for (Programmer programmer : programmers) { names.add(programmer.getName()); } return names; }
protected Programmer createProgrammer( final String firstName, final String lastName, final String programmingLanguage) { Programmer programmer = new Programmer(firstName, lastName); programmer.setId(ID_SEQUENCE.incrementAndGet()); programmer.setProgrammingLanguage(programmingLanguage); return programmer; }
protected Programmer save(final Programmer programmer) { getTemplate().put(programmer.getId(), programmer); return getTemplate().get(programmer.getId()); }