// Get DfpUser from "~/dfp.properties".
DfpUser user = new DfpUser();
// Get the ContactService.
ContactServiceInterface contactService =
user.getService(DfpService.V201311.CONTACT_SERVICE);
// Set defaults for page and filterStatement.
ContactPage page = new ContactPage();
Statement filterStatement = new Statement();
int offset = 0;
do {
// Create a statement to get all contacts.
filterStatement.setQuery("LIMIT 500 OFFSET " + offset);
// Get contacts by statement.
page = contactService.getContactsByStatement(filterStatement);
if (page.getResults() != null) {
int i = page.getStartIndex();
for (Contact contact : page.getResults()) {
System.out.printf(