toJavaList helper function

function [jxs] = toJavaList(xs, className)

%TOJAVALIST Converts a Matlab vector to a Java list.
%
%   Copyright (C) Bayes Server.  All rights reserved.


if ~exist('className','var')
    className = class(xs(1));
end

jxs = java.util.Arrays.asList(toJavaArray(xs, className));

end