### Question:
EidasConnectorMetrics { public static void increment(String entityId, Direction direction, Status status) { try { String country = getCountryCode(Objects.requireNonNull(entityId)); CONNECTOR_COUNTER.labels( country.toLowerCase(), Objects.requireNonNull(direction.name()), Objects.requireNonNull(status.name())) .inc(); } catch (IllegalArgumentException | NullPointerException e) { LOG.warn("Could not set counter for entityId '{}', direction '{}', status '{}'", entityId, direction, status, e); } }  static void increment(String entityId, Direction direction, Status status);  }### Answer:
@Test public void testIncrementingCounterWithParameters() throws Exception { Counter counter = mock(Counter.class); Counter.Child counterChild = mock(Counter.Child.class); setFinalStatic(EidasConnectorMetrics.class.getDeclaredField("CONNECTOR_COUNTER"), counter); when(counter.labels(expectedCountryCode, direction != null ? direction.name() : null, status != null ? status.name() : null)).thenReturn(counterChild); EidasConnectorMetrics.increment(entityId, direction, status); if (incrementsCounter) { verify(counterChild).inc(); } else { verifyNoInteractions(counter, counterChild); } }