@Test
public void doesNotResetInvocationCounterWhenInvocationCounterIsOutOfSyncForDeviceThatNeedsNoInvocationCounter()
        throws Exception {

    final DlmsDevice device = new DlmsDeviceBuilder().withHls5Active(true)
            .withProtocol("DSMR")
            .withInvocationCounter(123L)
            .build();
    final DlmsMessageListener listener = new InvocationCountingDlmsMessageListener();
    final ConnectionException exception = new ConnectionException(
            "Error creating connection for device E0051004228715518 with Ip address:62.133.88.34 Port:null "
                    + "UseHdlc:false UseSn:false Message:Socket was closed by remote host.");
    doThrow(exception).when(this.connectionFactory).getConnection(device, listener);
    try {
        this.helper.createConnectionForDevice(device, listener);
        fail("Expected ConnectionException");
    } catch (final ConnectionException e) {
        // expected
    }
    verifyNoMoreInteractions(this.invocationCounterManager);
}