### Question:
FermaFlowRepository extends FermaGenericRepository<Flow, FlowData, FlowFrame> implements FlowRepository { @Override public Collection<Flow> findByGroupId(String flowGroupId) { return framedGraph().traverse(g -> g.V() .hasLabel(FlowFrame.FRAME_LABEL) .has(FlowFrame.GROUP_ID_PROPERTY, flowGroupId)) .toListExplicit(FlowFrame.class).stream() .map(Flow::new) .collect(Collectors.toList()); } FermaFlowRepository(FramedGraphFactory<?> graphFactory, FlowPathRepository flowPathRepository,
                               TransactionManager transactionManager); @Override long countFlows(); @Override Collection<Flow> findAll(); @Override boolean exists(String flowId); @Override Optional<Flow> findById(String flowId); @Override Collection<Flow> findByGroupId(String flowGroupId); @Override Collection<String> findFlowsIdByGroupId(String flowGroupId); @Override Collection<Flow> findWithPeriodicPingsEnabled(); @Override Collection<Flow> findByEndpoint(SwitchId switchId, int port); @Override Optional<Flow> findByEndpointAndVlan(SwitchId switchId, int port, int vlan); @Override Optional<Flow> findOneSwitchFlowBySwitchIdInPortAndOutVlan(SwitchId switchId, int inPort, int outVlan); @Override Collection<Flow> findOneSwitchFlows(SwitchId switchId); @Override Collection<Flow> findByEndpointWithMultiTableSupport(SwitchId switchId, int port); @Override Collection<String> findFlowsIdsByEndpointWithMultiTableSupport(SwitchId switchId, int port); @Override Collection<String> findFlowIdsForMultiSwitchFlowsByEndpointWithMultiTableSupport(SwitchId switchId,
                                                                                            int port); @Override Collection<Flow> findByEndpointSwitch(SwitchId switchId); @Override Collection<Flow> findByEndpointSwitchWithMultiTableSupport(SwitchId switchId); @Override Collection<Flow> findByEndpointSwitchWithEnabledLldp(SwitchId switchId); @Override Collection<Flow> findByEndpointSwitchWithEnabledArp(SwitchId switchId); @Override Collection<Flow> findInactiveFlows(); @Override Collection<Flow> findByFlowFilter(FlowFilter flowFilter); @Override Optional<String> getOrCreateFlowGroupId(String flowId); @Override void updateStatus(@NonNull String flowId, @NonNull FlowStatus flowStatus); @Override void updateStatus(String flowId, FlowStatus flowStatus, String flowStatusInfo); @Override void updateStatusInfo(String flowId, String flowStatusInfo); @Override @TransactionRequired void updateStatusSafe(Flow flow, FlowStatus flowStatus, String flowStatusInfo); @Override long computeFlowsBandwidthSum(Set<String> flowIds); @Override Optional<Flow> remove(String flowId);  }### Answer:
@Test public void shouldFindFlowByGroupId() { Flow flow = createTestFlow(TEST_FLOW_ID, switchA, switchB); flow.setGroupId(TEST_GROUP_ID); List<Flow> foundFlow = Lists.newArrayList(flowRepository.findByGroupId(TEST_GROUP_ID)); assertThat(foundFlow, Matchers.hasSize(1)); assertEquals(Collections.singletonList(flow), foundFlow); }