I have this piece of code:
    Graph g = new Graph();
    doCoverOperation(g) 
where in doCoverOperation(g, subset) I tend to do some operation with g but I do not want to have any changes on my g. Since I came to understand Java is a pass by reference, I know this is how it is supposed to work, but is there a way I can pass a clone on doCoverOperation? Like, I do some operation with g on doCoverOperation but my g above does not change? 
Any ideas on this approach? Thank you further!
 
    