### Question:
AnnotationValuePairListItem implements AnnotationValuePairListItemView.Presenter, IsWidget { public void loadValuePair( final Annotation annotation, final AnnotationValuePairDefinition valuePairDefinition, final AnnotationSource annotationSource ) { this.annotation = annotation; this.valuePairDefinition = valuePairDefinition; view.setValuePairName( valuePairDefinition.getName( ) ); view.setValuePairStringValue( getValuePairStringValue( annotation, valuePairDefinition, annotationSource ) ); if ( valuePairDefinition.getDefaultValue( ) == null ) { view.showRequiredIndicator( true ); } } AnnotationValuePairListItem( ); @Inject  AnnotationValuePairListItem( AnnotationValuePairListItemView view ); @Override Widget asWidget( ); void loadValuePair( final Annotation annotation,
                               final AnnotationValuePairDefinition valuePairDefinition,
                               final AnnotationSource annotationSource ); void setReadonly( boolean readonly ); void setClearValuePairHandler( AdvancedAnnotationListEditorView.ClearValuePairHandler clearValuePairHandler ); void setEditValuePairHandler( AdvancedAnnotationListEditorView.EditValuePairHandler editValuePairHandler ); @Override void onEdit( ); @Override void onClear( );  }### Answer:
@Test public void testLoadValuePairWithValueSet( ) { when( annotation.getValue( VALUE_PAIR_NAME ) ).thenReturn( new Object( ) ); when( annotationSource.getValuePairSource( VALUE_PAIR_NAME ) ).thenReturn( VALUE_PAIR_SOURCE_CODE ); listItem.loadValuePair( annotation, valuePairDefinition, annotationSource ); verify( view, times( 1 ) ).setValuePairName( VALUE_PAIR_NAME ); verify( view, times( 1 ) ).setValuePairStringValue( VALUE_PAIR_SOURCE_CODE ); }
@Test public void testLoadValuePairWithValueNotSet( ) { when( annotation.getValue( VALUE_PAIR_NAME ) ).thenReturn( null ); when( annotationSource.getValuePairSource( VALUE_PAIR_NAME ) ).thenReturn( VALUE_PAIR_SOURCE_CODE ); listItem.loadValuePair( annotation, valuePairDefinition, annotationSource ); verify( view, times( 1 ) ).setValuePairName( VALUE_PAIR_NAME ); verify( view, times( 1 ) ).setValuePairStringValue( Constants.INSTANCE.advanced_domain_annotation_list_editor_message_value_not_set( ) ); }