### Question:
FermaFlowCookieRepository extends FermaGenericRepository<FlowCookie, FlowCookieData, FlowCookieFrame> implements FlowCookieRepository { @Override public Collection<FlowCookie> findAll() { return framedGraph().traverse(g -> g.V() .hasLabel(FlowCookieFrame.FRAME_LABEL)) .toListExplicit(FlowCookieFrame.class).stream() .map(FlowCookie::new) .collect(Collectors.toList()); } FermaFlowCookieRepository(FramedGraphFactory<?> graphFactory, TransactionManager transactionManager); @Override Collection<FlowCookie> findAll(); @Override boolean exists(long unmaskedCookie); @Override Optional<FlowCookie> findByCookie(long unmaskedCookie); @Override Optional<Long> findFirstUnassignedCookie(long lowestCookieValue, long highestCookieValue);  }### Answer:
@Test public void shouldCreateFlowCookie() { createFlowCookie(); Collection<FlowCookie> allCookies = flowCookieRepository.findAll(); FlowCookie foundCookie = allCookies.iterator().next(); assertEquals(TEST_COOKIE, foundCookie.getUnmaskedCookie()); assertEquals(TEST_FLOW_ID, foundCookie.getFlowId()); }
@Test public void shouldDeleteFlowCookie() { FlowCookie cookie = createFlowCookie(); transactionManager.doInTransaction(() -> flowCookieRepository.remove(cookie)); assertEquals(0, flowCookieRepository.findAll().size()); }
@Test public void shouldDeleteFoundFlowCookie() { createFlowCookie(); transactionManager.doInTransaction(() -> { Collection<FlowCookie> allCookies = flowCookieRepository.findAll(); FlowCookie foundCookie = allCookies.iterator().next(); flowCookieRepository.remove(foundCookie); }); assertEquals(0, flowCookieRepository.findAll().size()); }