test_class.file: core/src/test/java/dk/alexandra/fresco/framework/util/TestByteAndBitConverter.java
test_class.identifier: TestByteAndBitConverter
test_case.body: @Test
    public void testToBoolean() {
      boolean exception = false;
      try {
        ByteAndBitConverter.toBoolean("Foo");
      } catch (IllegalArgumentException e) {
        exception = true;
      }
      Assert.assertTrue(exception);
      Boolean[] x = ByteAndBitConverter.toBoolean("00");
      Boolean[] expectedX = new Boolean[]{false, false, false, false, false, false, false, false};
      Assert.assertEquals(expectedX.length, x.length);
      Assert.assertArrayEquals(expectedX, x);
      Boolean[] y = ByteAndBitConverter.toBoolean("42");
      Boolean[] expectedY = new Boolean[]{false, true, false, false, false, false, true, false};
      Assert.assertEquals(expectedY.length, y.length);
      Assert.assertArrayEquals(expectedY, y);
      Boolean[] z = ByteAndBitConverter.toBoolean("42FF");
      Boolean[] expectedZ = new Boolean[]{false, true, false, false, false, false, true, false,
          true, true, true, true, true, true, true, true};
      Assert.assertEquals(expectedZ.length, z.length);
      Assert.assertArrayEquals(expectedZ, z);
    }
test_case.class_method_signature: TestByteAndBitConverter.testToBoolean()
test_case.full_signature: @Test public void testToBoolean()
test_case.identifier: testToBoolean
test_case.invocations: toBoolean assertTrue toBoolean assertEquals assertArrayEquals toBoolean assertEquals assertArrayEquals toBoolean assertEquals assertArrayEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testToBoolean()
focal_class.file: core/src/main/java/dk/alexandra/fresco/framework/util/ByteAndBitConverter.java
focal_class.identifier: ByteAndBitConverter
focal_class.class_method_signature: ByteAndBitConverter.ByteAndBitConverter()
focal_class.full_signature: private  ByteAndBitConverter()
focal_class.identifier: ByteAndBitConverter
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  ByteAndBitConverter()
focal_class.class_method_signature: ByteAndBitConverter.toByteArray(long value)
focal_class.full_signature: public static byte[] toByteArray(long value)
focal_class.identifier: toByteArray
focal_class.modifiers: public static
focal_class.parameters: (long value)
focal_class.return: byte[]
focal_class.signature: byte[] toByteArray(long value)
focal_class.class_method_signature: ByteAndBitConverter.toByteArray(int value)
focal_class.full_signature: public static byte[] toByteArray(int value)
focal_class.identifier: toByteArray
focal_class.modifiers: public static
focal_class.parameters: (int value)
focal_class.return: byte[]
focal_class.signature: byte[] toByteArray(int value)
focal_class.class_method_signature: ByteAndBitConverter.intToBitSet(int i)
focal_class.full_signature: public static BitSet intToBitSet(int i)
focal_class.identifier: intToBitSet
focal_class.modifiers: public static
focal_class.parameters: (int i)
focal_class.return: BitSet
focal_class.signature: BitSet intToBitSet(int i)
focal_class.class_method_signature: ByteAndBitConverter.toBoolean(String hex)
focal_class.full_signature: public static Boolean[] toBoolean(String hex)
focal_class.identifier: toBoolean
focal_class.modifiers: public static
focal_class.parameters: (String hex)
focal_class.return: Boolean[]
focal_class.signature: Boolean[] toBoolean(String hex)
focal_class.class_method_signature: ByteAndBitConverter.toHex(boolean[] bits)
focal_class.full_signature: public static String toHex(boolean[] bits)
focal_class.identifier: toHex
focal_class.modifiers: public static
focal_class.parameters: (boolean[] bits)
focal_class.return: String
focal_class.signature: String toHex(boolean[] bits)
focal_class.class_method_signature: ByteAndBitConverter.toHex(List<Boolean> bits)
focal_class.full_signature: public static String toHex(List<Boolean> bits)
focal_class.identifier: toHex
focal_class.modifiers: public static
focal_class.parameters: (List<Boolean> bits)
focal_class.return: String
focal_class.signature: String toHex(List<Boolean> bits)
focal_class.class_method_signature: ByteAndBitConverter.convertArray(Boolean[] in)
focal_class.full_signature: private static boolean[] convertArray(Boolean[] in)
focal_class.identifier: convertArray
focal_class.modifiers: private static
focal_class.parameters: (Boolean[] in)
focal_class.return: boolean[]
focal_class.signature: boolean[] convertArray(Boolean[] in)
focal_method.body: public static Boolean[] toBoolean(String hex) throws IllegalArgumentException {
      if (hex.length() % 2 != 0) {
        throw new IllegalArgumentException("Illegal hex string");
      }
      Boolean[] res = new Boolean[hex.length() * 4]; // 8
      for (int i = 0; i < hex.length() / 2; i++) {
        String sub = hex.substring(2 * i, 2 * i + 2);
        int value = Integer.parseInt(sub, 16);
        int numOfBits = 8;
        for (int j = 0; j < numOfBits; j++) {
          boolean val = (value & 1 << j) != 0;
          res[8 * i + (numOfBits - j - 1)] = val;
        }
      }
      return res;
    }
focal_method.class_method_signature: ByteAndBitConverter.toBoolean(String hex)
focal_method.full_signature: public static Boolean[] toBoolean(String hex)
focal_method.identifier: toBoolean
focal_method.invocations: length length length substring parseInt
focal_method.modifiers: public static
focal_method.parameters: (String hex)
focal_method.return: Boolean[]
focal_method.signature: Boolean[] toBoolean(String hex)