We should have a utility method for this, something like "Strings.isNullOrEmpty(segment1)"