TableLineBuilder { public <C extends Enum<C>, R extends Enum<R>> TableLineBuilder withTableEnumCount( String statName, Table<R, C, Integer> countTable, Class<R> rowClass, Class<C> columnClass) { for (R enumRowValue : rowClass.getEnumConstants()) { for (C enumColumnValue : columnClass.getEnumConstants()) { withInt( String.format("%s_%s_%s", enumColumnValue, enumRowValue, statName), TableUtils.getOrDefault(countTable, enumRowValue, enumColumnValue, 0)); } } return this; }  TableLineBuilder withInt(String columnHeader, Integer value); TableLineBuilder withLong(String columnHeader, Long value); TableLineBuilder withId(String columnHeader, Id<?> id); TableLineBuilder withStringId(String columnHeader, StringId<?> id); TableLineBuilder withDouble(String columnHeader, Double value); TableLineBuilder withBoolean(String columnHeader, Boolean value); TableLineBuilder withTime(String columnHeader, LocalDateTime value); TableLineBuilder withString(String columnHeader, String value); TableLineBuilder withEnumValue(String columnHeader, T enumValue); TableLineBuilder withEnumCount(
            String statName,
            Map<T, Integer> countByEnum,
            Class<T> clazz); TableLineBuilder withTableEnumCount(
            String statName,
            Table<R, C, Integer> countTable,
            Class<R> rowClass,
            Class<C> columnClass); TableLineBuilder withExtension(TableLineExtender extender); TableLine build();  }
@Test void testWithTableEnumCount() { Builder<TestEnum, ExampleEnum, Integer> tBuilder = ImmutableTable.builder(); tBuilder.put(TestEnum.PRESENT_ELEMENTS, ExampleEnum.EXAMPLE, 3) .put(TestEnum.PRESENT_ELEMENTS, ExampleEnum.SECOND_EXAMPLE, 15) .put(TestEnum.MISSING_ELEMENTS, ExampleEnum.EXAMPLE, 1); ImmutableTable<TestEnum, ExampleEnum, Integer> testEnumCount = tBuilder.build(); TableLine tableLine = builder.withTableEnumCount( "COUNT", testEnumCount, TestEnum.class, ExampleEnum.class).build(); TableLine expectedTableLine = new TableLine(ImmutableMap.of( "EXAMPLE_PRESENT_ELEMENTS_COUNT", "3", "SECOND_EXAMPLE_PRESENT_ELEMENTS_COUNT", "15", "EXAMPLE_MISSING_ELEMENTS_COUNT", "1", "SECOND_EXAMPLE_MISSING_ELEMENTS_COUNT", "0"), ImmutableSet.of()); Assertions.assertEquals(expectedTableLine.getLineMap(), tableLine.getLineMap()); }