@Test
public void decodeDsmr4AlarmsWithAlarmRegister() throws UnrecognizedMessageDataException {

    // SETUP
    this.decoder = new DlmsPushNotificationDecoder();
    final ByteBuf buffer = mock(ByteBuf.class);
    // Create alarm register with 3 alarms: replace battery and 2 mbus
    // alarms
    final byte[] alarmRegister = new byte[] { 0x00, 0x18, 0x00, 0x02 };
    final byte[] bytes = this.setupDsmr4Buffer(buffer, IDENTIFIER, alarmRegister);
    // CALL
    final List<Object> out = new ArrayList<>();
    this.decoder.decode(this.ctx, buffer, out);
    final Object pushNotificationObject = out.get(0);
    // VERIFY
    assertThat(pushNotificationObject instanceof DlmsPushNotification).isTrue();
    final DlmsPushNotification dlmsPushNotification = (DlmsPushNotification) pushNotificationObject;
    assertThat(dlmsPushNotification.getEquipmentIdentifier()).isEqualTo(IDENTIFIER);
    assertThat(dlmsPushNotification.getTriggerType()).isEqualTo(PUSH_ALARM_TRIGGER);
    assertThat(dlmsPushNotification.toByteArray()).isEqualTo(bytes);
    final Set<AlarmTypeDto> alarms = dlmsPushNotification.getAlarms();
    assertThat(alarms.size()).isEqualTo(3);
    assertThat(alarms.contains(REPLACE_BATTERY)).isTrue();
    assertThat(alarms.contains(COMMUNICATION_ERROR_M_BUS_CHANNEL_4)).isTrue();
    assertThat(alarms.contains(FRAUD_ATTEMPT_M_BUS_CHANNEL_1)).isTrue();
    this.verifyDsmr4BufferCalls(buffer, alarmRegister);
}