AccessConfig { String cidrsLogParam(List<String> cidrs, int maxSize) { if (cidrs.size() <= maxSize) return String.valueOf(cidrs); return "[" + String.join(", ", cidrs.subList(0, maxSize)) + ", ...]"; } AccessConfig(ModuleContext context); void allow(List<String> cidrs); void deny(List<String> cidrs); void denyFromFile(String classpath);  }
@Test void cidrsLogParam() { assertThat(config.cidrsLogParam(List.of(), 2)).isEqualTo("[]"); assertThat(config.cidrsLogParam(List.of("1.1.1.1/24", "2.1.1.1/24"), 2)).isEqualTo("[1.1.1.1/24, 2.1.1.1/24]"); assertThat(config.cidrsLogParam(List.of("1.1.1.1/24", "2.1.1.1/24", "3.1.1.1/24"), 2)).isEqualTo("[1.1.1.1/24, 2.1.1.1/24, ...]"); }