I can define a resource management method which accepts any object which belongs to a class that provides a close method irrespective of whether that class implements close as part of an an interface or not.
//define it like this: def using[T <: {def close(): Unit }, S](obj: T) (operation: T => S) = { val result = operation(obj) obj.close() result }
//use it like this: val writer = new FunkyWriter using(writer) { writer.write("outputting some data") }
ARM was therefore possible in Scala before the Closable interface was even added to the Java libs.
lombok's @Cleanup will close anything, interface or not.