### Question:
BitInputStream extends NonBlockingBitInputStream { @Override public int readBit () throws IOException { m_aLock.lock (); try { return super.readBit (); } finally { m_aLock.unlock (); } } BitInputStream(@Nonnull final InputStream aIS, @Nonnull final ByteOrder aByteOrder); @Override int readBit(); @Override void close();  }### Answer:
@Test public void testReadBitLittleEndian () throws IOException { final NonBlockingByteArrayInputStream aBAIS = new NonBlockingByteArrayInputStream (new byte [] { (byte) 0x80 }); try (final BitInputStream aBIS = new BitInputStream (aBAIS, ByteOrder.LITTLE_ENDIAN)) { assertEquals (1, aBIS.readBit ()); for (int i = 0; i < 7; ++i) assertEquals (0, aBIS.readBit ()); } }
@Test public void testReadBitBigEndian () throws IOException { final NonBlockingByteArrayInputStream aBAIS = new NonBlockingByteArrayInputStream (new byte [] { (byte) 0x80 }); try (final BitInputStream aBIS = new BitInputStream (aBAIS, ByteOrder.BIG_ENDIAN)) { for (int i = 0; i < 7; ++i) assertEquals (0, aBIS.readBit ()); assertEquals (1, aBIS.readBit ()); } }