That's a nice snippet.. There is no need for 2 loops though, OSBot already has a method which searches for the item name:
bank.getItemForName();
So I formatted a bit, other than that I like it and was already using something similar.
private String getBankItem(String ...itemNames) {
Bank bank = this.client.getBank();
if(!client.getBank().isOpen() || itemNames == null || itemNames.length < 0) {
return null;
}
for(String name:itemNames){
Item selectedItem = bank.getItemForName(name);
if(selectedItem !=null){
return name;
}
}
return null;
}