to check whether an element exists in hashset in java code example Example: check if value exists in hashset java hSet.contains(new Integer("3"));