class OriginValidator {

    public void validate(CollectedClientData collectedClientData, ServerProperty serverProperty) {
        final Origin clientOrigin = collectedClientData.getOrigin();
        if (!serverProperty.getOrigins().contains(clientOrigin)) {
            throw new BadOriginException("The collectedClientData '" + clientOrigin + "' origin doesn't match any of the preconfigured server origin.");
        }
    }

}