### Question:
AssetGroupTargetDetailsServiceImpl implements AssetGroupTargetDetailsService, Constants { @Override public List<TargetTypeRuleDetails> getTargetTypesByAssetGroupName(String assetGroupName) { AssetGroupDetails assetGroupDetails = assetGroupService.findByGroupName(assetGroupName); List<AssetGroupTargetDetails> allAssetGroupTargetDetails = assetGroupTargetDetailsRepository.findByGroupId(assetGroupDetails.getGroupId()); List<TargetTypeRuleDetails> allStudentsDetails = allAssetGroupTargetDetails.parallelStream().map(fetchTargetTypeRuleDetails).collect(Collectors.toList()); return allStudentsDetails; }  @Override List<TargetTypeRuleDetails> getTargetTypesByAssetGroupName(String assetGroupName); @Override List<TargetTypeRuleViewDetails> getTargetTypesByAssetGroupIdAndTargetTypeNotIn(String assetGroupName, Set<String> targetTypeNames);  }### Answer:
@Test public void getTargetTypesByAssetGroupNameTest() throws PacManException { AssetGroupDetails assetGroupDetails = getAssetGroupDetails(); List<AssetGroupTargetDetails> allAssetGroupTargetDetails = getAllAssetGroupTargetDetails(); when(assetGroupService.findByGroupName("assetGroupName123")).thenReturn(assetGroupDetails); when(assetGroupTargetDetailsRepository.findByGroupId(assetGroupDetails.getGroupId())).thenReturn(allAssetGroupTargetDetails); assertThat(assetGroupTargetDetailsService.getTargetTypesByAssetGroupName("assetGroupName123").size(), is(1)); }