Hi all,

As requested (https://plus.google.com/u/0/103703750118158205464/posts) here is the dump of assertNotSame usage in CDK tests.
Most of these are actually okay, using primitives is fine and for example in AtomParityTest it's used to check the instances are the same. A couple though (i.e. assertNotSame(smiles3, smiles1);) are probably incorrect.

Here's the full list:

AtomParityTest:110: Assert.assertNotSame(atoms[f], atomsClone[g]);
AtomParityTest:130:        Assert.assertNotSame(parity.getAtom(), clone.getAtom());
atomtype.CDKAtomTypeMatcherSMILESTest:177:            Assert.assertNotSame("X", atom.getAtomTypeName());
CDKTest:34:        Assert.assertNotSame(0, CDK.getVersion().length());
CDKTest:35:        Assert.assertNotSame(
CDKTestCase:269:     Assert.assertNotSame("The String must not contain newline characters", '\n', c);
CDKTestCase:270:     Assert.assertNotSame("The String must not contain newline characters", '\r', c);
charges.PiElectronegativityTest:90:         Assert.assertNotSame(0.0, pe.calculatePiElectronegativity(molecule, molecule.getAtom(i)));
charges.PiElectronegativityTest:120:         Assert.assertNotSame(0.0, pe.calculatePiElectronegativity(molecule, molecule.getAtom(i),6,50));
charges.StabilizationChargesTest:86:         Assert.assertNotSame(0.0, sc.calculatePositive(molecule, molecule.getAtom(i)));
config.AtomTypeFactoryTest:80:        Assert.assertNotSame(atf.getSize(), 0);
config.AtomTypeFactoryTest:89:     Assert.assertNotSame(0, atf.getSize());
config.AtomTypeFactoryTest:97:     Assert.assertNotSame(0, atf.getSize());
config.AtomTypeFactoryTest:109:     Assert.assertNotSame(0, atf.getSize());
config.AtomTypeFactoryTest:117:     Assert.assertNotSame(0, types.length);
config.CDKBasedAtomTypeConfiguratorTest:54:        Assert.assertNotSame(0, configurator.readAtomTypes(new ChemObject().getBuilder()).size()
config.OWLBasedAtomTypeConfiguratorTest:50:        Assert.assertNotSame(0, configurator.readAtomTypes(new ChemObject().getBuilder()).size());
config.TXTBasedAtomTypeConfiguratorTest:54:        Assert.assertNotSame(0, configurator.readAtomTypes(new ChemObject().getBuilder()).size()
ConformerContainerTest:268:    .* note that assertNotSame checks whether object A *refers* to the same as object B
ConformerContainerTest:272:     Assert.assertNotSame(container.get(location+1), container.get(location));
dict.DictDBTest:80:     Assert.assertNotSame(0, dbName.length());
dict.DictDBTest:88:     Assert.assertNotSame(0, dbs.length);
dict.DictDBTest:91:     Assert.assertNotSame(0, dbName.length());
fingerprint.SignatureFingerprinterTest:69:        Assert.assertNotSame(0, bitFP.size());
fingerprint.SignatureFingerprinterTest:79:        Assert.assertNotSame(0, bitFP.size());
formula.IsotopePatternSimilarityTest:77: Assert.assertNotSame(0.0, score);
formula.MassToFormulaToolTest:532:.. Assert.assertNotSame(0, mfSet.size());
formula.MassToFormulaToolTest:659: Assert.assertNotSame(0, mfSet.size());
formula.MassToFormulaToolTest:712: Assert.assertNotSame(0, mfSet.size());
formula.MassToFormulaToolTest:770: Assert.assertNotSame(0, mfSet.size());
geometry.cip.CIPToolTest:214:            Assert.assertNotSame(
group.PartitionTest:285:        Assert.assertNotSame(p, null);
group.PartitionTest:292:        Assert.assertNotSame(p, o);
group.PermutationTest:74: Assert.assertNotSame(a, null);
group.PermutationTest:81: Assert.assertNotSame(a, b);
gui.smiles.SmilesGeneratorTest:440: Assert.assertNotSame(smiles3, smiles1);
gui.smiles.SmilesGeneratorTest:845: Assert.assertNotSame(smiles2, smiles1);
gui.smiles.SmilesGeneratorTest:875: Assert.assertNotSame(smiles2, smiles1);
interfaces.AbstractAdductFormulaTest:287:        Assert.assertNotSame(mfS, clone);
interfaces.AbstractAminoAcidTest:89:        Assert.assertNotSame(aa, clone);
interfaces.AbstractAminoAcidTest:96:        Assert.assertNotSame(aa, clone);
interfaces.AbstractAminoAcidTest:103:        Assert.assertNotSame(aa, clone);
interfaces.AbstractAtomContainerSetTest:363: Assert.assertNotSame(containerSet, clone);
interfaces.AbstractAtomContainerSetTest:372:         Assert.assertNotSame(containerSet, clonedSet);
interfaces.AbstractAtomContainerSetTest:382:         Assert.assertNotSame(containerSet, clonedSet);
interfaces.AbstractAtomContainerTest:114: Assert.assertNotSame(molecule.getAtom(f), clonedMol.getAtom(g));
interfaces.AbstractAtomContainerTest:125:        Assert.assertNotSame(molecule, clone);
interfaces.AbstractAtomContainerTest:142:        Assert.assertNotSame(molecule, clone);
interfaces.AbstractAtomContainerTest:156:        Assert.assertNotSame(molecule, clone);
interfaces.AbstractAtomContainerTest:170:        Assert.assertNotSame(molecule, clone);
interfaces.AbstractAtomContainerTest:204: Assert.assertNotSame(molecule.getBond(f), clonedMol.getBond(g));
interfaces.AbstractAtomContainerTest:220:        Assert.assertNotSame(atom1, clonedMol.getBond(0).getAtom(0));
interfaces.AbstractAtomContainerTest:221:        Assert.assertNotSame(atom2, clonedMol.getBond(0).getAtom(1));
interfaces.AbstractBondTest:332:        Assert.assertNotSame(atom1, clone.getAtom(0));
interfaces.AbstractBondTest:333:        Assert.assertNotSame(atom2, clone.getAtom(1));
interfaces.AbstractChemFileTest:149: Assert.assertNotSame(file.getChemSequence(f), clone.getChemSequence(g));
interfaces.AbstractChemModelTest:101:        Assert.assertNotSame(model.getMoleculeSet(), clone.getMoleculeSet());
interfaces.AbstractChemModelTest:112:        Assert.assertNotSame(model.getReactionSet(), clone.getReactionSet());
interfaces.AbstractChemModelTest:123:        Assert.assertNotSame(model.getCrystal(), clone.getCrystal());
interfaces.AbstractChemModelTest:134:        Assert.assertNotSame(model.getRingSet(), clone.getRingSet());
interfaces.AbstractChemObjectTest:137:        Assert.assertNotSame((short)0, chemObject.getFlagValue());
interfaces.AbstractChemObjectTest:148:        Assert.assertNotSame(chemObject.getFlagValue(), chemObject2.getFlagValue());
interfaces.AbstractChemSequenceTest:157: Assert.assertNotSame(sequence.getChemModel(f), clone.getChemModel(g));
interfaces.AbstractLonePairTest:82:        Assert.assertNotSame(atom, clone.getAtom());
interfaces.AbstractMappingTest:90: Assert.assertNotSame(mapping.getChemObject(f), clone.getChemObject(g));
interfaces.AbstractMolecularFormulaSetTest:228:        Assert.assertNotSame(mfS, clone);
interfaces.AbstractMolecularFormulaSetTest:258:        Assert.assertNotSame(mfS, clone);
interfaces.AbstractMoleculeTest:40: Assert.assertNotSame(molecule, clone);
interfaces.AbstractMonomerTest:78:        Assert.assertNotSame(oMonomer, clone);
interfaces.AbstractReactionSchemeTest:149:        Assert.assertNotSame(scheme, clone);
interfaces.AbstractReactionSetTest:130: Assert.assertNotSame(reactionSet.getReaction(f), clone.getReaction(g));
interfaces.AbstractRingSetTest:77:        Assert.assertNotSame(ring, clone.getAtomContainer(0));
interfaces.AbstractSingleElectronTest:80:        Assert.assertNotSame(atom, clone.getAtom());
io.FormatFactoryTest:271:     Assert.assertNotSame(0, formats.size());
io.formats.ChemFormatTest:54:            Assert.assertNotSame(
io.formats.ChemFormatTest:67:            Assert.assertNotSame(
io.formats.ResourceFormatTest:52:            Assert.assertNotSame(0, resourceFormat.getMIMEType().length());
io.formats.ResourceFormatTest:58:        Assert.assertNotSame(0, resourceFormat.getFormatName().length());
io.formats.ResourceFormatTest:71:            Assert.assertNotSame(0, prefExtension.length());
io.formats.ResourceFormatTest:100:                Assert.assertNotSame(0, extension.length());
io.MDLV2000WriterTest:225:        Assert.assertNotSame(0, output.length());
io.program.GaussianInputWriterTest:66:        Assert.assertNotSame(0, output.length());
io.ReaderFactoryTest:277:        Assert.assertNotSame(0, molecule.getAtomCount());
io.ReaderFactoryTest:278:        Assert.assertNotSame(0, molecule.getBondCount());
io.SDFWriterTest:105:        Assert.assertNotSame(0, writer.toString().length());
isomorphism.UniversalIsomorphismTesterTest:331:            Assert.assertNotSame(0, first.size());
isomorphism.UniversalIsomorphismTesterTest:339:            Assert.assertNotSame(0, first.size());
isomorphism.UniversalIsomorphismTesterTest:353:        Assert.assertNotSame(0, list.size());
isomorphism.UniversalIsomorphismTesterTest:357:            Assert.assertNotSame(0, first.size());
modeling.builder3d.FurtherAtomPlacer3DTest:325: Assert.assertNotSame(mmff94id1, id1);
modeling.builder3d.FurtherAtomPlacer3DTest:326: Assert.assertNotSame(mmff94id2, id2);
pharmacophore.PharmacophoreAtomTest:70:        Assert.assertNotSame(patom3, patom1);
pharmacophore.PharmacophoreAtomTest:71:        Assert.assertNotSame(patom4, patom1);
PolymerTest:108:        Assert.assertNotSame(monomer, clonedMonomer);
PolymerTest:110:        Assert.assertNotSame(atom, clonedAtom);
PolymerTest:114:        Assert.assertNotSame(atom, atomFromMonomer);
qsar.DescriptorEngineTest:69:        Assert.assertNotSame(0, loadedDescriptors);
qsar.DescriptorEngineTest:80:        Assert.assertNotSame(0, loadedDescriptors);
qsar.DescriptorEngineTest:159:     Assert.assertNotSame(0, loadedDescriptors);
qsar.descriptors.atomic.AtomicDescriptorTest:72:        Assert.assertNotSame(
qsar.descriptors.atomic.AtomicDescriptorTest:93:        Assert.assertNotSame(
qsar.descriptors.atomic.AtomicDescriptorTest:102:            Assert.assertNotSame(
qsar.descriptors.atomic.StabilizationPlusChargeDescriptorTest:81: Assert.assertNotSame(0.0,result.doubleValue());
qsar.descriptors.atomic.StabilizationPlusChargeDescriptorTest:128: Assert.assertNotSame(0.0,result.doubleValue());
qsar.descriptors.atomic.StabilizationPlusChargeDescriptorTest:227:        Assert.assertNotSame(resultA, resultB);
qsar.descriptors.bond.BondDescriptorTest:71:        Assert.assertNotSame(
qsar.descriptors.bond.BondDescriptorTest:93:        Assert.assertNotSame(
qsar.descriptors.bond.BondDescriptorTest:102:            Assert.assertNotSame(
qsar.descriptors.DescriptorTest:89:            Assert.assertNotSame(
qsar.descriptors.DescriptorTest:166:     Assert.assertNotSame(
qsar.descriptors.DescriptorTest:175:     Assert.assertNotSame(
qsar.descriptors.DescriptorTest:184:     Assert.assertNotSame(
qsar.descriptors.DescriptorTest:193:     Assert.assertNotSame(
qsar.descriptors.DescriptorTest:205:        Assert.assertNotSame("$Id$", spec.getImplementationIdentifier());
qsar.descriptors.molecular.MolecularDescriptorTest:130:        Assert.assertNotSame(
qsar.descriptors.molecular.MolecularDescriptorTest:139:         Assert.assertNotSame(
reaction.ReactionProcessTest:117: Assert.assertNotSame("The Entry ID from  ["+reaction.getClass()+"] doesn't exist.",
reaction.ReactionProcessTest:183:     Assert.assertNotSame(
reaction.ReactionProcessTest:192:     Assert.assertNotSame(
reaction.ReactionProcessTest:201:     Assert.assertNotSame(
reaction.ReactionProcessTest:210:     Assert.assertNotSame(
reaction.ReactionProcessTest:240:     Assert.assertNotSame(
reaction.ReactionProcessTest:288:..         Assert.assertNotSame("The representation entry for ["+entryString+"]  must contain the InChI id for each reactant.",
renderer.elements.path.AbstractPathElementTest:52: Assert.assertNotSame(0, points.length);
renderer.generators.BasicAtomGeneratorTest:355:        Assert.assertNotSame(0, distance(ovalA.xCoord, ovalA.yCoord, ovalB.xCoord, ovalB.yCoord));
renderer.generators.BasicBondGeneratorTest:59: Assert.assertNotSame(0, AbstractGeneratorTest.length(line));
renderer.generators.BasicGeneratorTest:81: Assert.assertNotSame(0, AbstractGeneratorTest.length(line));
renderer.generators.ExtendedAtomGeneratorTest:358:        Assert.assertNotSame(0, distance(ovalA.xCoord, ovalA.yCoord, ovalB.xCoord, ovalB.yCoord));
smiles.InvPairTest:57:     Assert.assertNotSame("NotSame", pair);
smiles.InvPairTest:58:     Assert.assertNotSame(new InvPair(), pair);
smiles.InvPairTest:71:     Assert.assertNotSame(atom, pair.getAtom());
smiles.InvPairTest:96:        Assert.assertNotSame(prime, pair.getPrime());
smiles.SmilesGeneratorTest:307: Assert.assertNotSame(smiles1, smiles3);
smiles.SmilesGeneratorTest:611: Assert.assertNotSame(smiles1, smiles2);
smiles.SmilesGeneratorTest:632: Assert.assertNotSame(smiles1, smiles2);
smiles.SmilesGeneratorTest:750: Assert.assertNotSame(moleculeSmile2, moleculeSmile1);
smsd.algorithm.rgraph.CDKRMapHandlerTest:203:        Assert.assertNotSame(true, instance.isTimeoutFlag());
smsd.global.TimeOutTest:92:        assertNotSame(expResult, result);
stereo.DoubleBondStereochemistryTest:271:        Assert.assertNotSame(0, stringRepr.length());
stereo.TetrahedralChiralityTest:272:        Assert.assertNotSame(0, stringRepr.length());
tools.diff.AtomContainerDiffTest:60:        Assert.assertNotSame(0, result.length());
tools.diff.AtomDiffTest:51:        Assert.assertNotSame(0, result.length());
tools.diff.AtomTypeDiffTest:50:        Assert.assertNotSame(0, result.length());
tools.diff.BondDiffTest:50:        Assert.assertNotSame(0, result.length());
tools.diff.ChemObjectDiffTest:49:        Assert.assertNotSame(
tools.diff.ElectronContainerDiffTest:48:        Assert.assertNotSame(0, result.length());
tools.diff.ElementDiffTest:49:        Assert.assertNotSame(0, result.length());
tools.diff.IsotopeDiffTest:50:        Assert.assertNotSame(0, result.length());
tools.diff.LonePairDiffTest:48:        Assert.assertNotSame(0, result.length());
tools.diff.SingleElectronDiffTest:50:        Assert.assertNotSame(0, result.length());
tools.HOSECodeGeneratorTest:88:        Assert.assertNotSame(code2, code1);