PropertyStatistics { public int getMax() { return issuesByProperty.values().stream().mapToInt(Report::size).max().orElse(0); } PropertyStatistics(final Report report,
            final String property, final Function<String, String> propertyFormatter); int getTotal(); String getProperty(); String getDisplayName(final String key); String getToolTip(final String key); Set<String> getKeys(); int getMax(); long getCount(final String key); long getErrorsCount(final String key); long getHighCount(final String key); long getNormalCount(final String key); long getLowCount(final String key);  }
@Test void shouldReturnMaxValueZero() { Report issues = new Report(); PropertyStatistics statistics = new PropertyStatistics(issues, "category", Function.identity()); int value = statistics.getMax(); assertThat(value).isEqualTo(0); }
@Test void shouldReturnMaxValue() { Report issues = new Report(); IssueBuilder builder = new IssueBuilder(); issues.add(builder.build()); PropertyStatistics statistics = new PropertyStatistics(issues, "category", Function.identity()); int value = statistics.getMax(); assertThat(value).isEqualTo(1); }
@Test void shouldReturnMaxValueTwo() { Report issues = new Report(); IssueBuilder builder = new IssueBuilder(); issues.add(builder.setCategory("ab").setPackageName("P1").build()); issues.add(builder.setCategory("ab").setPackageName("P2").build()); PropertyStatistics statistics = new PropertyStatistics(issues, "category", Function.identity()); int value = statistics.getMax(); assertThat(value).isEqualTo(2); }
@Test void shouldReturnMaxValueDifferentCategories() { Report issues = new Report(); IssueBuilder builder = new IssueBuilder(); issues.add(builder.setCategory("ab").setPackageName("P1").build()); issues.add(builder.setCategory("ab").setPackageName("P2").build()); issues.add(builder.setCategory("abc").setPackageName("P2").build()); PropertyStatistics statistics = new PropertyStatistics(issues, "category", Function.identity()); int value = statistics.getMax(); assertThat(value).isEqualTo(2); }