@Test public void addTrainingSet() { TrainingSetManager manager = new TrainingSetManager(); manager.reset(); TrainingSet trainingSet = manager.acquireTrainingSet(0); assertThat(trainingSet).isNull(); fillTrainingSetManager(manager, 10); trainingSet = manager.acquireTrainingSet(0); assertThat(trainingSet).isNotNull(); TrainingSet trainingSet2 = manager.acquireTrainingSet(1); assertThat(trainingSet2).isNotNull(); assertThat(trainingSet).isNotEqualTo(trainingSet2); }
public synchronized void addTrainingSet(TrainingSet trainingSet) { trainingSet.setTrainingSetID(trainingSetIDCounter++); trainingSets.add(trainingSet); }
TrainingSetManager { public synchronized void addTrainingSet(TrainingSet trainingSet) { trainingSet.setTrainingSetID(trainingSetIDCounter++); trainingSets.add(trainingSet); } }
TrainingSetManager { public synchronized void addTrainingSet(TrainingSet trainingSet) { trainingSet.setTrainingSetID(trainingSetIDCounter++); trainingSets.add(trainingSet); } TrainingSetManager(); }
TrainingSetManager { public synchronized void addTrainingSet(TrainingSet trainingSet) { trainingSet.setTrainingSetID(trainingSetIDCounter++); trainingSets.add(trainingSet); } TrainingSetManager(); synchronized void addTrainingSet(TrainingSet trainingSet); void addTrainingSets(Collection<TrainingSet> trainingSets); synchronized TrainingSet acquireTrainingSet(long id); boolean releaseTrainingSet(long id, boolean finished); void reset(); }
TrainingSetManager { public synchronized void addTrainingSet(TrainingSet trainingSet) { trainingSet.setTrainingSetID(trainingSetIDCounter++); trainingSets.add(trainingSet); } TrainingSetManager(); synchronized void addTrainingSet(TrainingSet trainingSet); void addTrainingSets(Collection<TrainingSet> trainingSets); synchronized TrainingSet acquireTrainingSet(long id); boolean releaseTrainingSet(long id, boolean finished); void reset();  }