Collections.list drains an old-style Enumeration, such as Vector.elements(), into a brand-new ArrayList, giving legacy APIs a clean way to hand data to modern List-based code.
Vector<String> legacy = new Vector<>(List.of("alpha", "beta", "gamma"));
Enumeration<String> e = legacy.elements();
List<String> modern = Collections.list(e);
System.out.println("Bridged into a List: " + modern);
System.out.println("Type: " + modern.getClass().getSimpleName());
Bridged into a List: [alpha, beta, gamma]
Type: ArrayList
Run this yourself in the Online Java Compiler, spin up a live REST API in the API Sandbox, or practise with Java interview questions.
Published 2026-09-27