### Question:
FermaSwitchRepository extends FermaGenericRepository<Switch, SwitchData, SwitchFrame> implements SwitchRepository { @Override public Collection<Switch> findAll() { return framedGraph().traverse(g -> g.V() .hasLabel(SwitchFrame.FRAME_LABEL)) .toListExplicit(SwitchFrame.class).stream() .map(Switch::new) .collect(Collectors.toList()); } FermaSwitchRepository(FramedGraphFactory<?> graphFactory, TransactionManager transactionManager); @Override Collection<Switch> findAll(); @Override boolean exists(SwitchId switchId); @Override Collection<Switch> findActive(); @Override Optional<Switch> findById(SwitchId switchId); @Override Collection<Switch> findSwitchesInFlowPathByFlowId(String flowId); @Override @TransactionRequired boolean removeIfNoDependant(Switch entity);  }### Answer:
@Test public void shouldCreateSwitch() { switchRepository.add(Switch.builder() .switchId(TEST_SWITCH_ID_A) .description("Some description") .build()); assertEquals(1, switchRepository.findAll().size()); }
@Test public void shouldDeleteSwitch() { Switch origSwitch = Switch.builder() .switchId(TEST_SWITCH_ID_A) .description("Some description") .build(); switchRepository.add(origSwitch); transactionManager.doInTransaction(() -> switchRepository.remove(origSwitch)); assertEquals(0, switchRepository.findAll().size()); }