### Question:
InvoiceUtil { public static boolean isLightningInvoice(@NonNull String data) { if (data.isEmpty() || data.length() < INVOICE_LIGHTNING_MIN_LENGTH) { return false; } return hasPrefix(INVOICE_PREFIX_LIGHTNING_MAINNET, data) || hasPrefix(INVOICE_PREFIX_LIGHTNING_TESTNET, data) || hasPrefix(INVOICE_PREFIX_LIGHTNING_REGTEST, data); }  static boolean isLightningInvoice(@NonNull String data); static boolean isBitcoinAddress(@NonNull String data); static void readInvoice(Context ctx, CompositeDisposable compositeDisposable, String data, OnReadInvoiceCompletedListener listener); static String INVOICE_PREFIX_LIGHTNING_MAINNET; static String INVOICE_PREFIX_LIGHTNING_TESTNET; static String INVOICE_PREFIX_LIGHTNING_REGTEST; static ArrayList<String> ADDRESS_PREFIX_ONCHAIN_MAINNET; static ArrayList<String> ADDRESS_PREFIX_ONCHAIN_TESTNET; static ArrayList<String> ADDRESS_PREFIX_ONCHAIN_REGTEST; }### Answer:
@Test public void givenLightningInvoiceTestnet_whenIsLightningInvoice_ThenIsLightningInvoiceReturnTrue() { String lightningUri = "lntb1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdpl2pkx2ctnv5sxxmmwwd5kgetjypeh2ursdae8g6twvus8g6rfwvs8qun0dfjkxaq8rkx3yf5tcsyz3d73gafnh3cax9rn449d9p5uxz9ezhhypd0elx87sjle52x86fux2ypatgddc6k63n7erqz25le42c4u4ecky03ylcqca784w"; assertTrue(InvoiceUtil.isLightningInvoice(lightningUri)); }
@Test public void givenArbitraryString_whenIsLightningInvoice_ThenIsLightningInvoiceReturnFalse() { String arbitraryString = "bitcoinFixesThis"; assertFalse(InvoiceUtil.isLightningInvoice(arbitraryString)); }
@Test public void givenLightningInvoiceMainnet_whenIsLightningInvoice_ThenIsLightningInvoiceReturnTrue() { String lightningUri = "lnbc1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdpl2pkx2ctnv5sxxmmwwd5kgetjypeh2ursdae8g6twvus8g6rfwvs8qun0dfjkxaq8rkx3yf5tcsyz3d73gafnh3cax9rn449d9p5uxz9ezhhypd0elx87sjle52x86fux2ypatgddc6k63n7erqz25le42c4u4ecky03ylcqca784w"; assertTrue(InvoiceUtil.isLightningInvoice(lightningUri)); }