Utils { public static boolean equalLists(List<String> one, List<String> two) { if (one == null && two == null) { return true; } if ((one == null && two != null) || one != null && two == null || one.size() != two.size()) { return false; } ArrayList<String> oneCopy = new ArrayList<>(one); ArrayList<String> twoCopy = new ArrayList<>(two); Collections.sort(oneCopy); Collections.sort(twoCopy); return one.equals(twoCopy); }  static String calculateITableName(String databaseName, String tableName, String indexName); static String calculateITableName(Index index); static String calculateITableName(IndexIdentifier indexId); @Deprecated static void initDatabase(String cqlPath, Session session); static void initDatabase(boolean dropDb, String replicationString, Session session); static void initDatabaseSingleReplication(boolean dropDb, Session session); static void setField(String value, IndexField fieldData, BoundStatement bs, int index); static boolean setField(DBObject jsonObject, IndexField fieldData, BoundStatement bs, int index); static String join(String delimiter, Object... objects); static String join(String delimiter, Collection<? extends Object> objects); static boolean equalLists(List<String> one, List<String> two); static void writeFile(String toWrite, String fileName); static String readFile(String fileName); static List<Long> traverse1RowFile(String fileName); static final String EMPTY_STRING; }
@Test public void testEqualLists() { logger.debug("equalLists"); List<String> one = null; List<String> two = null; boolean result = Utils.equalLists(one, two); assertEquals(true, result); one = new ArrayList<>(); two = new ArrayList<>(); result = Utils.equalLists(one, two); assertEquals(true, result); one.add("test"); two.add("test"); result = Utils.equalLists(one, two); assertEquals(true, result); two.add("testtest"); result = Utils.equalLists(one, two); assertEquals(false, result); two = new ArrayList<>(); result = Utils.equalLists(one, two); assertEquals(false, result); }