ConnectionLoggerFactory { static ConnectionLogger newEvictingLogger( final int successCapacity, final int failureCapacity, final LogCategory logCategory, final LogType logType, @Nullable final String address) { switch (logCategory) { case SOURCE: return newSourceLogger(logType, successCapacity, failureCapacity, address); case TARGET: return newTargetLogger(logType, successCapacity, failureCapacity, address); case RESPONSE: return newResponseLogger(logType, successCapacity, failureCapacity, address); case CONNECTION: return newConnectionLogger(logType, successCapacity, failureCapacity, address); default: throw new AssertionError("Missing switch case."); } } private  ConnectionLoggerFactory();   }
@Test @SuppressWarnings("squid:S2699") public void verifyAllCategoriesAndTypesRunWithoutException() { Arrays.stream(LogCategory.values()) .forEach(category -> { Arrays.stream(LogType.values()) .forEach(type -> ConnectionLoggerFactory.newEvictingLogger(1, 1, category, type, "1")); }); }