Here you can find the source of Contains(Set s, Object o)
public static boolean Contains(Set s, Object o)
//package com.java2s; //License from project: Open Source License import java.util.Set; import java.util.Iterator; public class Main { public static boolean Contains(Set s, Object o) { if (!s.contains(o)) { if (o instanceof Number) { double val = ((Number) o).doubleValue(); for (Iterator it = s.iterator(); it.hasNext();) { Object e = it.next(); if (e instanceof Number) if (val == ((Number) e).doubleValue()) return true; }// www.j a va 2 s . c om } return false; } return true; } }