Inspired in https://github.com/alexferreira/restgen but in java