Using object as ArrayList type

How do I make an ArrayList, with object as the data type for the values in it? I would like to make an ArrayList for a list of my commands within my plugin. In this array list, I’d like to have the built command, and the command name. But, the built command data type (I think that’s what it’s called) is CommandSpec while the command name (like “/this-is-my-command-in-game”, that sort of thing) is a String. I do believe there is a way to tell ArrayList that its value types are going to be object (hence, it could have both data types).

Also, it’d be nice if someone could point out how you could put an ArrayList inside of an ArrayList, and be able to use everything in it.

Thank you very much!

Sounds like what you’re really after is a Map. With keys of String and values of CommandSpec.
so private final Map<String, CommandSpec> commands = Maps.newHashMap(); for example.

Otherwise you could use a Tuple<String, CommandSpec> in the list so the list would be
List<Tuple<String, CommandSpec>>

To answer your original question you can just do ArrayList<Object>

ArrayList<ArrayList<SomethingHere>> then add new arraylists to the first like this:
list.add(new ArrayList<>());