Java code example using admin REST API creating policies and attributes on roles

Dow anyone have a JAVA code example to create policies and also attributes on roles. I am using the ADMIN API so hoping to get the rest calls to do this. Any help is appreciated.

Thanks.