SynchronizationListener implements ContentChangedListener, StepMetaChangeListenerInterface { public void install( TransMeta transMeta ) { List<ContentChangedListener> listeners = transMeta.getContentChangedListeners(); if ( FluentIterable.from( listeners ).filter( SynchronizationListener.class ).isEmpty() ) { transMeta.addContentChangedListener( this ); transMeta.addStepChangeListener( this ); } } SynchronizationListener( DataServiceDelegate delegate,
                                  DataServiceReferenceSynchronizer synchronizer ); @Override void contentChanged( Object parentObject ); @Override void contentSafe( Object parentObject ); @Override void onStepChange( TransMeta transMeta, StepMeta oldMeta, StepMeta newMeta ); void install( TransMeta transMeta ); boolean isPrompt(); void setPrompt( boolean prompt );  }
@Test public void testInstall() throws Exception { when( transMeta.getContentChangedListeners() ).thenReturn( ImmutableList.<ContentChangedListener>of() ); service.install( transMeta ); verify( transMeta ).addStepChangeListener( service ); verify( transMeta ).addContentChangedListener( service ); when( transMeta.getContentChangedListeners() ).thenReturn( ImmutableList.<ContentChangedListener>of( service ) ); verifyNoMoreInteractions( ignoreStubs( transMeta ) ); }