@@ -0,0 +1,1500 @@
+package com.twu.biblioteca;%0A%0Aimport com.twu.biblioteca.menu.LibrarianMenu;%0Aimport com.twu.biblioteca.menu.MainMenu;%0Aimport com.twu.biblioteca.menu.Menu;%0Aimport com.twu.biblioteca.menu.UserMenu;%0Aimport com.twu.biblioteca.user.Librarian;%0Aimport com.twu.biblioteca.user.User;%0Aimport com.twu.biblioteca.user.UserAuthentication;%0A%0Apublic class MenuCreator %7B%0A%0A    private final Repository repository;%0A    private final InputReader inputReader;%0A    private final OutputWriter outputWriter;%0A    private Menu menu;%0A    private final UserAuthentication userAuthentication;%0A%0A    MenuCreator(OutputWriter outputWriter, InputReader inputReader, Repository repository, UserAuthentication userAuthentication) %7B%0A        this.outputWriter = outputWriter;%0A        this.inputReader = inputReader;%0A        this.repository = repository;%0A        this.userAuthentication = userAuthentication;%0A    %7D%0A%0A    public Menu getMenu() %7B%0A        customiseMenu();%0A        return menu;%0A    %7D%0A%0A    private void customiseMenu() %7B%0A        User currentUser = userAuthentication.getCurrentUser();%0A        if (currentUser == null) %7B%0A            this.menu = new MainMenu(repository, outputWriter, inputReader, userAuthentication);%0A            return;%0A        %7D%0A        if (currentUser instanceof Librarian) %7B%0A            this.menu = new LibrarianMenu(repository, outputWriter, inputReader, userAuthentication);%0A            return;%0A        %7D%0A        this.menu = new UserMenu(repository, outputWriter, inputReader, userAuthentication);%0A    %7D%0A%0A%7D%0A

Create menu based on user type