Distinctness and Sharing Domains for Static Analysis of Java Programs