/**
   * administratie wordt vanuit geserialiseerd bestand gevuld
   *
   * @param bestand
   * @throws IOException
   */
  public void deserialize(File bestand) throws IOException {
    Properties props = new Properties(); // Zie Serialize methode
    props.setProperty("file", bestand.getAbsolutePath());
    storageMediator.configure(props);
    admin = storageMediator.load();
    // todo opgave 2 X

  }
  /**
   * administratie wordt in geserialiseerd bestand opgeslagen
   *
   * @param bestand
   * @throws IOException
   */
  public void serialize(File bestand) throws IOException {
    // todo opgave 2 X
    Properties props = new Properties(); // Init nieuwe properties
    props.setProperty("file", bestand.getAbsolutePath()); // Zet het path correct
    storageMediator.configure(props); // Configureer de mediator

    storageMediator.save(admin); // Sla het object op
  }
  /**
   * administratie wordt vanuit geserialiseerd bestand gevuld
   *
   * @param bestand
   * @throws IOException
   */
  public void deserialize(File bestand) throws IOException {

    // todo opgave 2
    // set file property
    Properties p = storageMediator.config();
    // check null, C# would be ?? but doesn't exist in java
    if (p == null) p = new Properties();
    p.setProperty("file", bestand.getAbsolutePath());
    storageMediator.configure(p);

    admin = storageMediator.load();
  }
 // opgave 4
 private void initDatabaseMedium() throws IOException {
   if (!(storageMediator instanceof DatabaseMediator)) {
     Properties props = new Properties();
     try (FileInputStream in = new FileInputStream("database.properties")) {
       props.load(in);
     }
     storageMediator = new DatabaseMediator();
     storageMediator.configure(props);
   }
 }
 /**
  * administratie wordt vanuit standaarddatabase opgehaald
  *
  * @throws IOException
  */
 public void loadFromDatabase() throws IOException {
   initDatabaseMedium();
   admin = storageMediator.load();
   // opgave 4
 }
 /**
  * administratie wordt in standaarddatabase bewaard
  *
  * @throws IOException
  */
 public void saveToDatabase() throws IOException {
   initDatabaseMedium();
   // todo opgave 4
   storageMediator.save(admin);
 }