I think it fails here because source compatibility is set to use 1.6 inside gradle build. With 1.7 this works as expected.