Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.ArrayList;

import java.util.Iterator;
import java.util.List;
import java.util.Set;

public class Main {

    public static List toList(Set set) {
        if (set == null) {
            return null;
        }
        if (set.size() == 0)
            return new ArrayList();
        List list = new ArrayList();
        Iterator itor = set.iterator();
        while (itor.hasNext()) {
            Object obj = itor.next();
            list.add(obj);
        }
        return list;
    }
}