@Test void createList() { assertNull(groceryList.getId()); emptyRepository.createList(groceryList); assertNotNull(groceryList.getId()); assertTrue(emptyRepository.getList(groceryList.getId()).isPresent()); }
public synchronized GroceryList createList(GroceryList groceryList) { UUID newId = UUID.randomUUID(); groceryList.setId(newId); groceryLists.add(groceryList); save(); return groceryList; }
Repository { public synchronized GroceryList createList(GroceryList groceryList) { UUID newId = UUID.randomUUID(); groceryList.setId(newId); groceryLists.add(groceryList); save(); return groceryList; } }
Repository { public synchronized GroceryList createList(GroceryList groceryList) { UUID newId = UUID.randomUUID(); groceryList.setId(newId); groceryLists.add(groceryList); save(); return groceryList; } Repository();  Repository(String repoFilePath); }
Repository { public synchronized GroceryList createList(GroceryList groceryList) { UUID newId = UUID.randomUUID(); groceryList.setId(newId); groceryLists.add(groceryList); save(); return groceryList; } Repository();  Repository(String repoFilePath); synchronized GroceryList createList(GroceryList groceryList); Optional<GroceryList> getList(UUID id); GroceryLists getLists(); synchronized boolean updateList(UUID uuid, GroceryList updatedList); synchronized boolean deleteList(UUID uuid); }
Repository { public synchronized GroceryList createList(GroceryList groceryList) { UUID newId = UUID.randomUUID(); groceryList.setId(newId); groceryLists.add(groceryList); save(); return groceryList; } Repository();  Repository(String repoFilePath); synchronized GroceryList createList(GroceryList groceryList); Optional<GroceryList> getList(UUID id); GroceryLists getLists(); synchronized boolean updateList(UUID uuid, GroceryList updatedList); synchronized boolean deleteList(UUID uuid);  }