collection functions in java code example Example: how to define a collection in java List list = Arrays.asList("Lars", "Simon");