@Override
    public void save(Administratie admin) throws IOException {
        if (!isCorrectlyConfigured()) {
            throw new RuntimeException("Serialization mediator isn't initialized correctly.");
        }

        // todo opgave 2
        ObjectOutputStream out = null;
        FileOutputStream stream = null;
        try{
            stream = new FileOutputStream("stamboomadministratie.txt");
            out = new ObjectOutputStream(stream);
            out.writeObject(admin);
        }
        catch(IOException exc)
        {
            exc.printStackTrace();
        }
        finally{
            if(out != null)
                out.close();
            if(stream != null)
                stream.close();
        }
    }