Fix using Java 8 API
Merge pull request #2 from rafalmag/master

Fix using Java 8 API