public static String preprocessNavigationExpression(String with) {
        if ( null == with || 0 >= with.trim().length() ) {
            throw new IllegalArgumentException("Argument with is empty or null.");
        }
        int first = with.indexOf('.');
        int last = with.lastIndexOf('.');
        if ( first == last && 1 >= with.length() ) {
            throw new IllegalArgumentException("Argument with is illegal: with = " + with);
        }
        if ( last == with.length() - 1 ) {
            with = with.substring(0, last);
        }
        if ( first == 0 ) {
            with = with.substring(1);
        }
        return with;
    }