class AdvancedSearchContactCSVServlet extends HttpServlet {

    protected String generateCSVBody (final List<ContactPosition> contactPositions, final Map<String, String> texts) {
        final StringBuilder body = new StringBuilder();
        body.append(this.generateCSVHeader(texts));
        for (ContactPosition contactPosition: contactPositions) {
            if (contactPosition.isActive()) {
                body.append(this.generateCSVItem(contactPosition));
            }
        }
        return body.toString();
    }

}