### Question:
WorkflowHelperImpl implements WorkflowHelper { @Override public String[] buildArguments(MetaDataMap metaData) { String processArgs = metaData.get(PROCESS_ARGS, String.class); if (processArgs != null && !processArgs.equals("")) { return processArgs.split(","); } else { return new String[0]; } }  @Override final ResourceResolver getResourceResolver(com.adobe.granite.workflow.WorkflowSession workflowSession); @Override final ResourceResolver getResourceResolver(WorkflowSession workflowSession); @Override AssetResourceResolverPair getAssetFromPayload(WorkItem item, WorkflowSession workflowSession); @Override String getExtension(String mimetype); @Override String[] buildArguments(MetaDataMap metaData); @Override List<String> getValuesFromArgs(String name, String[] args); @Override double getQuality(double base, String qualityStr); @Override final Resource getPageOrAssetResource(ResourceResolver resourceResolver, String path); @Override boolean isPathTypedPayload(WorkflowData workflowData); @Override boolean isPathTypedPayload(com.adobe.granite.workflow.exec.WorkflowData workflowData);  }### Answer:
@Test public void testBuildArgumentsFromNullArguments() throws Exception { MetaDataMap map = mock(MetaDataMap.class); when(map.get(WorkflowHelper.PROCESS_ARGS, String.class)).thenReturn(null); String[] result = workflowHelper.buildArguments(map); assertNotNull(result); assertEquals(0, result.length); }
@Test public void testBuildArgumentsFromBlankArguments() throws Exception { MetaDataMap map = mock(MetaDataMap.class); when(map.get(WorkflowHelper.PROCESS_ARGS, String.class)).thenReturn(""); String[] result = workflowHelper.buildArguments(map); assertNotNull(result); assertEquals(0, result.length); }
@Test public void testBuildArguments() throws Exception { MetaDataMap map = mock(MetaDataMap.class); when(map.get(WorkflowHelper.PROCESS_ARGS, String.class)).thenReturn("foo:bar,goo:baz"); String[] result = workflowHelper.buildArguments(map); assertNotNull(result); assertEquals(2, result.length); assertEquals("foo:bar", result[0]); assertEquals("goo:baz", result[1]); }