public MaterialAgent createAgent(MaterialRevision revision) {
        Material material = revision.getMaterial();
        if (material instanceof DependencyMaterial) {
            return MaterialAgent.NO_OP;
        } else if (material instanceof PackageMaterial) {
            return MaterialAgent.NO_OP;
        } else if (material instanceof PluggableSCMMaterial) {
            return new PluggableSCMMaterialAgent(scmExtension, revision, workingDirectory, consumer);
        } else if (material instanceof ScmMaterial) {
            String destFolderPath = ((ScmMaterial) material).workingdir(workingDirectory).getAbsolutePath();
            return new AbstractMaterialAgent(revision, consumer, workingDirectory, new AgentSubprocessExecutionContext(agentIdentifier, destFolderPath));
        }
        throw new RuntimeException("Could not find MaterialChecker for material = " + material);
    }
@Test
    public void shouldGetPluggableSCMMaterialAgent() {
        File workingDirectory = new File("/tmp/workingDirectory");
        MaterialRevision revision = new MaterialRevision(new PluggableSCMMaterial(), new Modifications());
        MaterialAgentFactory factory = new MaterialAgentFactory(null, workingDirectory, null, scmExtension);
        MaterialAgent agent = factory.createAgent(revision);

        assertThat(agent instanceof PluggableSCMMaterialAgent, is(true));
        assertThat(ReflectionUtil.getField(agent, "scmExtension"), is(scmExtension));
        assertThat(ReflectionUtil.getField(agent, "revision"), is(revision));
        assertThat(ReflectionUtil.getField(agent, "workingDirectory"), is(workingDirectory));
    }