MidiDevice.Info[] devices = getDeviceInfo(); for (Info element : devices) { if (info.equals(element)) { return true; } } return false;