@Test public void testCollectInformationsWhenThereIsNoDescriptor() { given(sequenceManager.getDescriptors()).willReturn(new HashMap<String, SequenceDescriptor>()); Map<String, Object> result = underTest.collectInformation(); int sum = (int) result.get(SequenceInformationCollector.SUM_KEY); Assert.assertEquals(sum, 0); Map<String, Integer> groups = (Map<String, Integer>) result.get(SequenceInformationCollector.GROUPS_KEY); Assert.assertEquals(groups.size(), 0); }
public Map<String, Object> collectInformation() { Map<String, Object> result = new HashMap<>(); Map<String, Integer> countOfGroups = new HashMap<>(); Map<String, SequenceDescriptor> descriptors = sequenceManager.getDescriptors(); int sumSequenceCount = 0; for (String seqDescriptorKey : descriptors.keySet()) { int countOfSequences = descriptors.get(seqDescriptorKey).getSequences().size(); sumSequenceCount += countOfSequences; countOfGroups.put(seqDescriptorKey, countOfSequences); } result.put(SUM_KEY, sumSequenceCount); result.put(GROUPS_KEY, countOfGroups); return result; }
SequenceInformationCollector { public Map<String, Object> collectInformation() { Map<String, Object> result = new HashMap<>(); Map<String, Integer> countOfGroups = new HashMap<>(); Map<String, SequenceDescriptor> descriptors = sequenceManager.getDescriptors(); int sumSequenceCount = 0; for (String seqDescriptorKey : descriptors.keySet()) { int countOfSequences = descriptors.get(seqDescriptorKey).getSequences().size(); sumSequenceCount += countOfSequences; countOfGroups.put(seqDescriptorKey, countOfSequences); } result.put(SUM_KEY, sumSequenceCount); result.put(GROUPS_KEY, countOfGroups); return result; } }
SequenceInformationCollector { public Map<String, Object> collectInformation() { Map<String, Object> result = new HashMap<>(); Map<String, Integer> countOfGroups = new HashMap<>(); Map<String, SequenceDescriptor> descriptors = sequenceManager.getDescriptors(); int sumSequenceCount = 0; for (String seqDescriptorKey : descriptors.keySet()) { int countOfSequences = descriptors.get(seqDescriptorKey).getSequences().size(); sumSequenceCount += countOfSequences; countOfGroups.put(seqDescriptorKey, countOfSequences); } result.put(SUM_KEY, sumSequenceCount); result.put(GROUPS_KEY, countOfGroups); return result; }  }
SequenceInformationCollector { public Map<String, Object> collectInformation() { Map<String, Object> result = new HashMap<>(); Map<String, Integer> countOfGroups = new HashMap<>(); Map<String, SequenceDescriptor> descriptors = sequenceManager.getDescriptors(); int sumSequenceCount = 0; for (String seqDescriptorKey : descriptors.keySet()) { int countOfSequences = descriptors.get(seqDescriptorKey).getSequences().size(); sumSequenceCount += countOfSequences; countOfGroups.put(seqDescriptorKey, countOfSequences); } result.put(SUM_KEY, sumSequenceCount); result.put(GROUPS_KEY, countOfGroups); return result; }  Map<String, Object> collectInformation(); }
SequenceInformationCollector { public Map<String, Object> collectInformation() { Map<String, Object> result = new HashMap<>(); Map<String, Integer> countOfGroups = new HashMap<>(); Map<String, SequenceDescriptor> descriptors = sequenceManager.getDescriptors(); int sumSequenceCount = 0; for (String seqDescriptorKey : descriptors.keySet()) { int countOfSequences = descriptors.get(seqDescriptorKey).getSequences().size(); sumSequenceCount += countOfSequences; countOfGroups.put(seqDescriptorKey, countOfSequences); } result.put(SUM_KEY, sumSequenceCount); result.put(GROUPS_KEY, countOfGroups); return result; }  Map<String, Object> collectInformation();  }