### Question:
BitUtilLittle extends BitUtil { @Override public byte[] fromBitString(String str) { int strLen = str.length(); int bLen = str.length() / 8; if (strLen % 8 != 0) bLen++; byte[] bytes = new byte[bLen]; int charI = 0; for (int b = bLen - 1; b >= 0; b--) { byte res = 0; for (int i = 0; i < 8; i++) { res <<= 1; if (charI < strLen && str.charAt(charI) != '0') res |= 1; charI++; } bytes[b] = res; } return bytes; } BitUtilLittle(); @Override final short toShort(byte[] b, int offset); @Override void fromShort(byte[] bytes, short value, int offset); @Override final int toInt(byte[] b, int offset); @Override final void fromInt(byte[] bytes, int value, int offset); @Override final long toLong(int int0, int int1); @Override final long toLong(byte[] b, int offset); @Override final void fromLong(byte[] bytes, long value, int offset); @Override byte[] fromBitString(String str); @Override String toBitString(byte[] bytes); @Override String toString();  }### Answer:
@Test public void testFromBitString() { String str = "001110110"; assertEquals(str + "0000000", bitUtil.toBitString(bitUtil.fromBitString(str))); str = "01011110010111000000111111000111"; assertEquals(str, bitUtil.toBitString(bitUtil.fromBitString(str))); str = "0101111001011100000011111100011"; assertEquals(str + "0", bitUtil.toBitString(bitUtil.fromBitString(str))); }