Repository { public synchronized boolean deleteList(UUID uuid) { boolean success = groceryLists.removeIf(list -> uuid.equals(list.getId())); save(); return success; } Repository();  Repository(String repoFilePath); synchronized UUID createList(GroceryList groceryList); Optional<GroceryList> getList(UUID id); GroceryLists getLists(); synchronized boolean updateList(UUID uuid, GroceryList updatedList); synchronized boolean deleteList(UUID uuid);  }
@Test void deleteList() { List<GroceryList> defaultLists = defaultRepository.getLists().getGroceryLists(); defaultLists.forEach(sl -> emptyRepository.createList(sl)); assertTrue(emptyRepository.deleteList(defaultLists.get(1).getId())); assertFalse(emptyRepository.deleteList(UUID.randomUUID())); assertEquals(2, emptyRepository.getLists().size()); }