Java tutorial
//package com.java2s; import java.util.Map; import java.util.Set; public class Main { public static boolean checkRepeatOrNot(Map<String, Object> map, Set[] sets, String[] fields) { for (int i = 0; i < fields.length; i++) { if (!sets[i].add(map.get(fields[i]))) { return true; } } return false; } }