BitmaskMeasurementElement implements MeasurementElement, Serializable { public boolean getFlag(final BitmaskFlag flag) { return (this.value & flag.value) > 0; } BitmaskMeasurementElement(final Byte value); Byte getValue(); boolean getFlag(final BitmaskFlag flag); Set<BitmaskFlag> asEnumSet(); @Override boolean equals(final Object obj); @Override int hashCode(); @Override String toString();  }
@Test public void getFlagShouldReturnFalseWhenFlagIsNotSet() { final Byte bitmask = (byte) 0; final BitmaskMeasurementElement element = new BitmaskMeasurementElement(bitmask); final boolean expected = false; final boolean actual = element.getFlag(BitmaskFlag.FLAG_1); assertThat(actual).isEqualTo(expected); }
@Test public void getFlagShouldReturnTrueWhenFlagIsSet() { final Byte bitmask = (byte) 1; final BitmaskMeasurementElement element = new BitmaskMeasurementElement(bitmask); final boolean expected = true; final boolean actual = element.getFlag(BitmaskFlag.FLAG_1); assertThat(actual).isEqualTo(expected); }