@Test
public void validate()
{

    OptionSet optionSet = new OptionSet();
    optionSet.setUid( "optionSet1" );
    Option option = new Option();
    option.setName( "optionName" );
    option.setCode( "optionCode" );
    optionSet.addOption( option );
    OptionSet persistedOptionSet = new OptionSet();
    persistedOptionSet.setUid( "optionSet1" );
    Option persistedOption = new Option();
    persistedOption.setName( "optionName" );
    persistedOption.setCode( "optionCode" );
    persistedOptionSet.addOption( persistedOption );
    preheat.put( PreheatIdentifier.UID, persistedOptionSet );
    ObjectBundleParams objectBundleParams = new ObjectBundleParams();
    objectBundleParams.setPreheatIdentifier( PreheatIdentifier.UID );
    ObjectBundle bundle = new ObjectBundle( objectBundleParams, preheat,
        Collections.singletonMap( OptionSet.class, Collections.singletonList( persistedOptionSet ) ) );
    List<ErrorReport> errors = hook.validate( option, bundle );
    Assert.assertNotNull( errors );
    Assert.assertEquals( 1, errors.size() );
    Assert.assertEquals( ErrorCode.E4028, errors.get( 0 ).getErrorCode() );
}