class MailTransportUtils {

	public static InternetAddress getTo(URI uri) {
		Matcher matcher = TO_PATTERN.matcher(uri.getSchemeSpecificPart());
		if (matcher.find()) {
			for (int i = 1; i <= matcher.groupCount(); i++) {
				String group = matcher.group(i);
				if (group != null) {
					try {
						return new InternetAddress(group);
					} catch (AddressException e) {
						// try next group
					}
				}
			}
		}
		return null;
	}

	private  MailTransportUtils();

}