Tools { public static int boolToInt (boolean bool) { return bool ? 1 : 0; }  static int getRandom(int min, int max); static String getMethodName(final int depth); static Transaction applyBIP69(Transaction transaction); static List<TransactionSignature> getChannelSignatures(Channel channel, Transaction transaction); static String InputStreamToString(InputStream in); static boolean arrayListContainsByteArray(ArrayList<byte[]> arrayList, byte[] bytes); static int boolToInt(boolean bool); static T getRandomItemFromList(List<T> list); static List<T> getRandomSubList(List<T> input, int subsetSize); static String byteToString(byte[] array); static String byteToString58(byte[] array); static String bytesToHex(byte[] bytes); static boolean checkSignature(Transaction transaction, int index, TransactionOutput outputToSpend, ECKey key, byte[] signature); static boolean checkSignature(Transaction transaction, int index, Script outputToSpend, ECKey key, TransactionSignature signature); static boolean checkTransactionFees(int size, Transaction transaction, TransactionOutput output); static boolean checkTransactionLockTime(Transaction transaction, int locktime); static int currentTime(); static int currentTimeFlooredToCurrentDay(); static long getCoinValueFromOutput(List<TransactionOutput> output); static Script getDummyScript(); static String getFourCharacterHash(String s); static Message getMessage(String data); static Script getMultisigInputScript(ECDSASignature client, ECDSASignature server); static byte[] getRandomByte(int amount); static List<byte[]> byteBufferListToByteArrayList(List<ByteBuffer> byteBufferList); static byte[] copyRandomByteInByteArray(byte[] dest, int offset, int length); static TransactionSignature getSignature(Transaction transactionToSign, int index, TransactionOutput outputToSpend, ECKey key); static TransactionSignature getSignature(Transaction transactionToSign, int index, byte[] outputToSpend, ECKey key); static long getTransactionFees(int size); static long getTransactionFees(int size, float feePerByte); static long getTransactionFees(int inputs, int outputs); static long getTransactionFees(int inputs, int outputs, float feePerByte); static boolean checkIfExistingInOutPutsAreEqual(Transaction o, Transaction n); static byte[] hashSecret(byte[] secret); static String hashSecretToString(byte[] secret); static byte[] hashSha(byte[] secret); static byte[] hashSha(byte[] secret, int rounds); static byte[] hexStringToByteArray(String s); static boolean intToBool(int i); static Transaction setTransactionLockTime(Transaction transaction, int locktime); static String stacktraceToString(Exception e); static byte[] stringToByte(String string); static byte[] stringToByte58(String string);  }
@Test public void testBoolToInt () { assertEquals(Tools.boolToInt(true), 1); assertEquals(Tools.boolToInt(false), 0); }