class DestinationValidator {

    public void validate(String destination) {
        if(destination == null) throw new SamlValidationException(destinationMissing(expectedUri));

        URI destinationURI = URI.create(destination);

        URI destinationURIWithoutPort;
        destinationURIWithoutPort = uriWithoutPort(destinationURI, destinationURI.getPath());

        if (!expectedUri.equals(destinationURIWithoutPort))
            throw new SamlValidationException(destinationEmpty(expectedUri, destination));
    }

    public  DestinationValidator(URI expectedDestinationHost, String expectedEndpoint);

}