CAST array into UDT in Java JDBC with Oracle DB

I am trying to CAST an array (which is a value list of a Linked hashmap). By CAST I am referring to Oracle sql CAST function.

For eg, please refer the below (UDT is a user defined datatype)

select cast(multiset(select 1 from dual) as **UDT**) from dual;

I was trying the below code in java, but I am unable to find a solution:

String sql2 = "select cast(multiset("+  linkedhashmap.values() +" ) as **UDT**) from dual";
            PreparedStatement ps3=conn.prepareStatement(sql2);
            ResultSet rs2 = ps3.executeQuery();

I am getting an error: ORA-00936: missing expression

How can I achieve this?