GraphicalComponent a = new GraphicalComponent();
GraphicalComponent b = new GraphicalComponent();
a.getModelRole().setGraphicURI(uriOne);
b.getModelRole().setGraphicURI(uriTwo);
ModelStatePersistence persisterA = a.getCapability(ModelStatePersistence.class);
ModelStatePersistence persisterB = b.getCapability(ModelStatePersistence.class);
Assert.assertNotNull(persisterA);
Assert.assertNotNull(persisterB);
// Swap models
String stateA = persisterA.getModelState();
String stateB = persisterB.getModelState();
persisterA.setModelState(stateB);
persisterB.setModelState(stateA);
// Ensure they have switched
Assert.assertEquals(b.getModelRole().getGraphicURI(), uriOne);
Assert.assertEquals(a.getModelRole().getGraphicURI(), uriTwo);
}