HashGeneratorMaker { public HashGeneratorMaker depth(int depth) { if (depth < 0) throw new IllegalArgumentException("depth must not be less than 0"); this.depth = depth; return this; }  HashGeneratorMaker depth(int depth); HashGeneratorMaker elemental(); HashGeneratorMaker isotopic(); HashGeneratorMaker charged(); HashGeneratorMaker orbital(); HashGeneratorMaker radical(); HashGeneratorMaker chiral(); HashGeneratorMaker suppressHydrogens(); HashGeneratorMaker perturbed(); HashGeneratorMaker encode(AtomEncoder encoder); EnsembleHashGenerator ensemble(); MoleculeHashGenerator molecular(); AtomHashGenerator atomic();  }
@Test(expected = IllegalArgumentException.class) public void testInvalidDepth() { new HashGeneratorMaker().depth(-1); }
@Test public void testDepth() throws NoSuchFieldException, IllegalAccessException { AtomHashGenerator generator = new HashGeneratorMaker().depth(5).elemental().atomic(); Field depthField = generator.getClass().getDeclaredField("depth"); depthField.setAccessible(true); int value = depthField.getInt(generator); assertThat(value, is(5)); }