@Override
    public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
        if (this instanceof SimpleBuildStep) {
            // delegate to the overloaded version defined in SimpleBuildStep
            final SimpleBuildStep step = (SimpleBuildStep) this;
            final FilePath workspace = build.getWorkspace();
            if (step.requiresWorkspace() && workspace == null) {
                throw new AbortException("no workspace for " + build);
            }
            if (workspace != null) { // if we have one, provide it regardless of whether it's _required_
                step.perform(build, workspace, build.getEnvironment(listener), launcher, listener);
            } else {
                step.perform(build, build.getEnvironment(listener), listener);
            }
            return true;
        } else if (build instanceof Build) {
            // delegate to the legacy signature deprecated in 1.312
            return perform((Build) build, launcher, listener);
        } else {
            return true;
        }
    }
@Issue("JENKINS-18734")
    @Test
    @SuppressWarnings("deprecation")
    public void testPerform() throws InterruptedException, IOException {

        FreeStyleBuild mock = Mockito.mock(FreeStyleBuild.class, Mockito.CALLS_REAL_METHODS);
        BuildStepCompatibilityLayer bscl = new BuildStepCompatibilityLayer() {

            @Override
            public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) {
                return true;
            }
        };
        assertTrue(bscl.perform(mock, null, null));

    }