Java tutorial
//package com.java2s; //License from project: Apache License import java.util.HashSet; import java.util.List; import java.util.Set; public class Main { @SafeVarargs public static boolean equalsSize(List<? extends Object>... lists) { Set<Integer> sizes = new HashSet<Integer>(lists.length); for (List<? extends Object> list : lists) { if (list == null) { return false; } if (sizes.isEmpty()) { sizes.add(list.size()); } else { if (sizes.add(list.size())) { return false; } } } return true; } }