The polarity of a magnet can be tested by bringing both its poles, in turn, adjacent to the known poles of a suspended magnet. Repulsion only occurs between the like poles of a magnet. Attraction might occur between unlike poles and a magnetic material thus repulsion is the only sure way to test for polarity.