AlarmHelperService { public Integer toBitPosition(final AlarmTypeDto alarmType) { return BYTE_REGISTER_CONVERTER.toBitPosition(alarmType); }  Map<AlarmTypeDto, Integer> getAlarmRegisterBitIndexPerAlarmType(); Integer toBitPosition(final AlarmTypeDto alarmType); Set<AlarmTypeDto> toAlarmTypes(final Number registerValue); Long toLongValue(final Set<AlarmTypeDto> alarmTypes);  }
@Test public void testBitPositions() { assertEquals(0, (int) this.alarmHelperService.toBitPosition(AlarmTypeDto.CLOCK_INVALID)); assertEquals(8, (int) this.alarmHelperService.toBitPosition(AlarmTypeDto.PROGRAM_MEMORY_ERROR)); assertEquals(12, (int) this.alarmHelperService.toBitPosition(AlarmTypeDto.WATCHDOG_ERROR)); assertEquals(16, (int) this.alarmHelperService.toBitPosition(AlarmTypeDto.COMMUNICATION_ERROR_M_BUS_CHANNEL_1)); assertEquals(20, (int) this.alarmHelperService.toBitPosition(AlarmTypeDto.FRAUD_ATTEMPT_M_BUS_CHANNEL_1)); assertEquals(24, (int) this.alarmHelperService.toBitPosition(AlarmTypeDto.NEW_M_BUS_DEVICE_DISCOVERED_CHANNEL_1)); }