ProjectStats implements IProjectStats { @Override public List<IConceptStats> getConceptCount(List<INetwork> networks) throws QuadrigaStorageException { HashMap<String, ConceptStats> mapStats = new HashMap<String, ConceptStats>(); for (INetwork n : networks) { ITransformedNetwork transformedNetwork = transformationManager.getTransformedNetwork(n.getNetworkId()); if (transformedNetwork != null) { Map<String, Node> mapNodes = transformedNetwork.getNodes(); for (Node node : mapNodes.values()) { String url = node.getConceptId(); if (mapStats.containsKey(url)) { mapStats.get(url).incrementCount(); } else { ConceptStats conceptStats = new ConceptStats(url, node.getDescription(), node.getLabel(), 1); mapStats.put(url, conceptStats); } } } } List<IConceptStats> valuesList = new ArrayList<IConceptStats>(mapStats.values()); return getSortedList(valuesList); }  @Override List<IConceptStats> getConceptCount(List<INetwork> networks); List<IConceptStats> getSortedList(List<IConceptStats> csList); @Override List<IUserStats> getUserStats(String projectId);  }
@Test public void getConceptCountTest() throws QuadrigaStorageException { List<IConceptStats> conceptStatsList = projectStatsUnderTest .getConceptCount(mockedNetworkList); assertTrue(conceptStatsList.containsAll(mockedConceptStatsList) && mockedConceptStatsList.containsAll(conceptStatsList)); }
@Test public void getSortedConceptCountTest() throws QuadrigaStorageException { assertEquals(mockedConceptStatsList, projectStatsUnderTest.getConceptCount(mockedNetworkList)); }