/** * Test for your ArrayStorage implementation */ public class MainTestArrayStorage { static final ArrayStorage ARRAY_STORAGE = new ArrayStorage(); static int ARRAY_STORAGE_LIMIT = 10_000; public static void main(String[] args) { Resume r1 = new Resume(); r1.setUuid("uuid1"); Resume r2 = new Resume(); r2.setUuid("uuid2"); Resume r3 = new Resume(); r3.setUuid("uuid3"); Resume r2new = new Resume(); r2new.setUuid("uuid2"); ARRAY_STORAGE.save(r1); ARRAY_STORAGE.save(r2); ARRAY_STORAGE.save(r3); System.out.println("Get r1: " + ARRAY_STORAGE.get(r1.getUuid())); System.out.println("Size: " + ARRAY_STORAGE.size()); System.out.println("Get dummy: " + ARRAY_STORAGE.get("dummy")); ARRAY_STORAGE.save(r2new); ARRAY_STORAGE.update(r2new); System.out.println("Get r2new: " + ARRAY_STORAGE.get(r2new.getUuid())); ARRAY_STORAGE.get("uuid111"); ARRAY_STORAGE.delete("uuid111"); printAll(); ARRAY_STORAGE.delete(r1.getUuid()); printAll(); ARRAY_STORAGE.clear(); printAll(); System.out.println("Size: " + ARRAY_STORAGE.size()); for (int i = 0; i <= ARRAY_STORAGE_LIMIT; i++) { Resume r = new Resume(); r.setUuid("uuid" + i); ARRAY_STORAGE.save(r); } System.out.println("Size: " + ARRAY_STORAGE.size()); } static void printAll() { System.out.println("\nGet All"); for (Resume r : ARRAY_STORAGE.getAll()) { System.out.println(r); } } }