An electroscope that might have a static charge is tested on a metal surface. From there, the charges move to the metal and straight to the foil leaves. If they repel, or move away from each other, that means they have identical charges. This applies for both positive and negative static electricity.
work cited: School of champions, Google