class StoreVersionCheck {

    public Result hasVersion( File neostoreFile, String expectedVersion )
    {
        Optional<String> storeVersion;

        try
        {
            storeVersion = getVersion( neostoreFile );
        }
        catch ( IOException e )
        {
            // since we cannot read let's assume the file is not there
            return new Result( Outcome.missingStoreFile, null, neostoreFile.getName() );
        }

        return storeVersion
                .map( v ->
                        expectedVersion.equals( v ) ?
                        new Result( Outcome.ok, null, neostoreFile.getName() ) :
                        new Result( Outcome.unexpectedStoreVersion, v, neostoreFile.getName() ) )
                .orElseGet( () -> new Result( Outcome.storeVersionNotFound, null, neostoreFile.getName() ) );
    }

    public  StoreVersionCheck( PageCache pageCache );

}