EOEditingContext editingContext = ERXEC.newEditingContext();
for (int i = 0; i < 10; i++) {
Company.createCompany(editingContext, "Test Company " + i);
}
editingContext.saveChanges();
EOFetchSpecification fetchSpec = new EOFetchSpecification("Company", null, Company.NAME.descs());
fetchSpec.setFetchLimit(1);
NSArray<Company> companies = editingContext.objectsWithFetchSpecification(fetchSpec);
assertEquals(1, companies.size());
assertEquals("Test Company 9", companies.objectAtIndex(0).name());
}