### Question:
SamplingPointGenerationTool extends BasicTool { static Workflow createPointGeneratorWorkflow(WorkflowContext workflowContext) { final String sampleGeneratorName = workflowContext.getSampleGeneratorName(); if ("sobol".equalsIgnoreCase(sampleGeneratorName)) { return new GenerateSobolPointsWorkflow(workflowContext); } else if ("insitu".equalsIgnoreCase(sampleGeneratorName)) { return new GenerateInsituPointsWorkflow(workflowContext); } throw new IllegalArgumentException("Invalid generator name: " + sampleGeneratorName); } SamplingPointGenerationTool(); static void main(String[] args); @Override void initialize();  }### Answer:
@Test public void testCreatePointGeneratorWorkflow() { workflowContext.setInsituSensorName("wtf"); final Storage storage = mock(Storage.class); final PersistenceManager persistenceManager = mock(PersistenceManager.class); when(persistenceManager.getStorage()).thenReturn(storage); workflowContext.setPersistenceManager(persistenceManager); workflowContext.setSampleGeneratorName("SOBOL"); Workflow workflow = SamplingPointGenerationTool.createPointGeneratorWorkflow(workflowContext); assertTrue(workflow instanceof GenerateSobolPointsWorkflow); workflowContext.setSampleGeneratorName("INSITU"); workflow = SamplingPointGenerationTool.createPointGeneratorWorkflow(workflowContext); assertTrue(workflow instanceof GenerateInsituPointsWorkflow); }
@Test public void testCreatePointGeneratorWorkflow_invalidParameter() { workflowContext.setSampleGeneratorName("STRANGE_NAME"); try { SamplingPointGenerationTool.createPointGeneratorWorkflow(workflowContext); fail("IllegalArgumentException expected"); } catch (IllegalArgumentException expected) { assertEquals("Invalid generator name: STRANGE_NAME", expected.getMessage()); } }