JBBPFieldBoolean extends JBBPAbstractField implements JBBPNumericField { @Override public int getAsInt() { return this.value ? 1 : 0; } JBBPFieldBoolean(final JBBPNamedFieldInfo name, final boolean value); static long reverseBits(final boolean value); @Override double getAsDouble(); @Override float getAsFloat(); @Override int getAsInt(); @Override long getAsLong(); @Override boolean getAsBool(); @Override long getAsInvertedBitOrder(); @Override String getTypeAsString();  }
@Test public void testgetAsInt() { assertEquals(1, new JBBPFieldBoolean(new JBBPNamedFieldInfo("test.field", "field", 123), true).getAsInt()); assertEquals(0, new JBBPFieldBoolean(new JBBPNamedFieldInfo("test.field", "field", 123), false).getAsInt()); }