I have a List that is guaranteed to contain just one type object. This is created by some underlying code in a library that I cannot update. I want to create a List
List objectsWithType = Arrays.asList((ObjectType[])wildcardObjects).toArray());
But remember that this will produce a fixed length List. If you try to add or remove element from this list, it will throw an error. So be always careful while using Arrays.asList().