@SuppressWarnings("unchecked")
	private<PType extends IPerformances> List<GenericTestResults<Double, CTDiscreteNode, ICTClassifier<Double,CTDiscreteNode>, PType>> executeTests(
			List<ITestFactory<Double, CTDiscreteNode, ICTClassifier<Double,CTDiscreteNode>, PType>> testFactories,
			List<ITrajectory<Double>> dataset,
			ICTClassifier<Double,CTDiscreteNode> baseNBModel) {

		this.verbosePrint("Execute tests:\n");
		
		// Inizialization
		Set<String> classStates = new TreeSet<String>();
		for( int i = 0; i < baseNBModel.getClassNode().getStatesNumber(); ++i)
			classStates.add( baseNBModel.getClassNode().getStateName(i));
		
		List<GenericTestResults<Double, CTDiscreteNode, ICTClassifier<Double,CTDiscreteNode>, PType>> resultsList =
				new Vector<GenericTestResults<Double, CTDiscreteNode, ICTClassifier<Double,CTDiscreteNode>, PType>>(this.modelToTest.size());
		
		// Tests
		for( int i = 0; i < this.modelToTest.size(); ++i) {
			
			String[] modelData = this.modelToTest.get(i);
			String modelName = "M" + i + "_" + modelData[0] + (modelData.length > 5 ? modelData[5] + "-" + modelData[6] : "");
			this.verbosePrint("\t. model " + modelName + "\n");
			
			// Test execution
			this.verbosePrint("\t. test running\n");
			ITestResults<Double,CTDiscreteNode,ICTClassifier<Double,CTDiscreteNode>,PType> result =
				testFactories.get(i).newTest(modelName, baseNBModel, dataset);
			resultsList.add( (GenericTestResults<Double, CTDiscreteNode, ICTClassifier<Double,CTDiscreteNode>, PType>) result);
			
			// Result printing
			this.verbosePrint("\t. result printing\n");
			try {
				if( this.cvValidation != null)
					printTestResults(this.resultsPath, (GenericTestResults<Double, CTDiscreteNode, ICTClassifier<Double,CTDiscreteNode>, MicroMacroClassificationPerformances<Double, ClassificationStandardPerformances<Double>>>) result,
							classStates, baseNBModel.getClassNode().getName(), this.confidenceLevel, dataset.size(), this.testName, this.cvValidation.getKFolds());
				else if( this.hoValidation != null)
					printTestResults(this.resultsPath, (GenericTestResults<Double, CTDiscreteNode, ICTClassifier<Double,CTDiscreteNode>, ClassificationStandardPerformances<Double>>) result,
							classStates, baseNBModel.getClassNode().getName(), this.confidenceLevel, dataset.size(), this.testName);
				else if( this.clusteringValidation != null)
					printTestResults(this.resultsPath, (GenericTestResults<Double, CTDiscreteNode, ICTClassifier<Double,CTDiscreteNode>, ClusteringExternalPerformances<Double>>) result,
							classStates, baseNBModel.getClassNode().getName(), dataset.size(), this.testName, this.testType.equals("hard"));
			}catch(Exception e) {
				System.err.println("Error during the result printing for model " + modelName + ": " + e);
				e.printStackTrace();
				System.exit(1);
			}
		}

		this.verbosePrint("Execute tests (END)\n");
		
		return resultsList;
	}