What does the arrow operator, ‘->’, do in Java?

While hunting through some code I came across the arrow operator, what exactly does it do? I thought Java did not have an arrow operator. return (Collection<Car>) CollectionUtils.select(listOfCars, (arg0) -> { return Car.SEDAN == ((Car)arg0).getStyle(); }); Details: Java 6, Apache Commons Collection, IntelliJ 12 Update/Answer: It turns out that IntelliJ 12 supports Java 8, which … Read more

How to convert a Collection to List?

I am using TreeBidiMap from the Apache Collections library. I want to sort this on the values which are doubles. My method is to retrieve a Collection of the values using: Collection coll = themap.values(); Which naturally works fine. Main Question: I now want to know how I can convert/cast (not sure which is correct) … Read more