public CRMaterial getMaterialByName(String name) {
        if (this.materials == null)
            return null;
        for (CRMaterial m : this.materials) {
            if (m.getName().equals(name))
                return m;
        }
        return null;
    }
@Test
    public void shouldHandlePolymorphismWhenDeserializingJobs() {
        String json = gson.toJson(pipe1);

        CRPipeline deserializedValue = gson.fromJson(json, CRPipeline.class);

        CRMaterial git = deserializedValue.getMaterialByName("gitMaterial1");
        assertThat(git).isInstanceOf(CRGitMaterial.class);
        assertThat(((CRGitMaterial) git).getBranch()).isEqualTo("feature12");
    }