fun test_ConstructorIF() { val hs2 = HashSet<Any>(5, 0.5.toFloat()) assertEquals("Created incorrect HashSet", 0, hs2.size()) try { HashSet(0, 0) } catch (e: IllegalArgumentException) { return } fail("Failed to throw IllegalArgumentException for initial load factor <= 0") }
java.util.HashSet # HashSet ( int , float )