// Get graphic legend from style
final Style style = RendererBaseTest.loadStyle(
this, "testGraphicLegend.sld");
final Rule rule = style.featureTypeStyles().get(0).rules().get(0);
final GraphicLegend legend = (GraphicLegend) rule.getLegend();
// Set rotation to 45 degrees
legend.setRotation( ff.literal(45.0) );
// Paint legend using StyledShapePainter
final Point point = gf.createPoint(new Coordinate(width / 2, height / 2));
final LiteShape2 shape = new LiteShape2(point, null, null, false);