using Collections.singleton instead of HashSet