public void createTrainingSet() {
        boolean done = false;

        while (!done || !hasMoreElements()) {
            MinstItem i = nextElement();

            if (r.nextDouble() > 0.3) {
                List<MinstItem> l = testSet.get(i.label);
                if (l == null)
                    l = new ArrayList<MinstItem>();
                testSet.put(i.label, l);

                l.add(i);
            } else {
                List<MinstItem> l = trainingSet.get(i.label);
                if (l == null)
                    l = new ArrayList<MinstItem>();
                trainingSet.put(i.label, l);

                l.add(i);
            }

            if (trainingSet.isEmpty())
                continue;

            boolean isDone = true;
            for (Map.Entry<String, List<MinstItem>> entry : trainingSet.entrySet()) {
                if (entry.getValue().size() < 100) {
                    isDone = false;
                    break;
                }
            }

            done = isDone;
        }
    }