@Test void isPowerOfTwoTest() { assertTrue(is_power_of_two(1)); assertTrue(is_power_of_two(2)); assertTrue(is_power_of_two(512)); assertTrue(is_power_of_two(0x040000)); assertFalse(is_power_of_two(0)); assertFalse(is_power_of_two(42)); assertFalse(is_power_of_two(Integer.MAX_VALUE)); assertFalse(is_power_of_two(-1)); assertFalse(is_power_of_two(-16)); assertFalse(is_power_of_two(Integer.MIN_VALUE)); }
@VisibleForTesting static boolean is_power_of_two(int value) { return value > 0 && (value & (value - 1)) == 0; }
HashTreeUtil { @VisibleForTesting static boolean is_power_of_two(int value) { return value > 0 && (value & (value - 1)) == 0; } }
HashTreeUtil { @VisibleForTesting static boolean is_power_of_two(int value) { return value > 0 && (value & (value - 1)) == 0; }  }
HashTreeUtil { @VisibleForTesting static boolean is_power_of_two(int value) { return value > 0 && (value & (value - 1)) == 0; }  static Bytes32 hash_tree_root(SSZTypes sszType, Bytes... bytes); @SuppressWarnings({"rawtypes", "unchecked"}) static Bytes32 hash_tree_root(SSZTypes sszType, SSZImmutableCollection bytes); static Bytes32 hash_tree_root_list_ul(SSZList<Bytes> bytes); static Bytes32 hash_tree_root_vector_uint64(SSZVector<UInt64> vector); @SuppressWarnings({"rawtypes", "unchecked"}) static Bytes32 hash_tree_root(SSZTypes sszType, SSZList bytes); static Bytes32 merkleize1(List<Bytes32> sszChunks, long limit); static Bytes32 merkleize(List<Bytes32> chunks, long limit); static Bytes32 merkleize(List<Bytes32> sszChunks); static Bytes32 hash_tree_root_bitlist(Bitlist bitlist); static Bytes32 hash_tree_root_bitvector(Bitvector bitvector); static Bytes32 hash_tree_root_list_bytes(SSZList<Bytes32> bytes); }
HashTreeUtil { @VisibleForTesting static boolean is_power_of_two(int value) { return value > 0 && (value & (value - 1)) == 0; }  static Bytes32 hash_tree_root(SSZTypes sszType, Bytes... bytes); @SuppressWarnings({"rawtypes", "unchecked"}) static Bytes32 hash_tree_root(SSZTypes sszType, SSZImmutableCollection bytes); static Bytes32 hash_tree_root_list_ul(SSZList<Bytes> bytes); static Bytes32 hash_tree_root_vector_uint64(SSZVector<UInt64> vector); @SuppressWarnings({"rawtypes", "unchecked"}) static Bytes32 hash_tree_root(SSZTypes sszType, SSZList bytes); static Bytes32 merkleize1(List<Bytes32> sszChunks, long limit); static Bytes32 merkleize(List<Bytes32> chunks, long limit); static Bytes32 merkleize(List<Bytes32> sszChunks); static Bytes32 hash_tree_root_bitlist(Bitlist bitlist); static Bytes32 hash_tree_root_bitvector(Bitvector bitvector); static Bytes32 hash_tree_root_list_bytes(SSZList<Bytes32> bytes); static final int BYTES_PER_CHUNK; }