    public void startUpdateChecker(){
        executor.scheduleAtFixedRate(() -> {
            logger.info("Checking for a new update...");
            checkUpdate().whenComplete((version, throwable) -> {
                if(version == null || throwable != null){
                    logger.warn("Failed to look for any updates. See previous messages for reasons.");
                    return;
                }

                int result = version.compare(core.getVersion());
                switch(result){
                    case -2 -> {
                        logger.warn("Encountered an exception while comparing versions. Are they valid?");
                        logger.warn("Own version: %s; New version: %s", core.getVersion(), version.getVersionNumber());
                    }
                    case -1 -> logger.info("You seem to run a newer version compared to Modrinth. Are you running a dev build?");
                    case 0 -> logger.info("No new update found. You're running the latest version!");
                    case 1 -> printUpdateBanner(version.getVersionNumber(), version.getId());
                }
            });
        }, 0L, 12L, TimeUnit.HOURS);
    }

    public void startUpdateChecker(){
        timer.scheduleAtFixedRate(
            new TimerTask(){
                @Override
                public void run(){
                    logger.info("Checking for a new update...");
                    checkUpdate().whenComplete((version, throwable) -> {
                        if(version == null || throwable != null){
                            logger.warn("Failed to look for any updates. See previous messages for reasons.");
                            return;
                        }

                        int result = version.compare(core.getVersion());
                        switch(result){
                            case -2 -> {
                                logger.warn("Encountered an exception while comparing versions. Are they valid?");
                                logger.warn("Own version: %s; New version: %s", core.getVersion(), version.getVersionNumber());
                            }
                            case -1 -> logger.info("You seem to run a newer version compared to Modrinth. Are you running a dev build?");
                            case 0 -> logger.info("No new update found. You're running the latest version!");
                            case 1 -> printUpdateBanner(version.getVersionNumber(), version.getId());
                        }
                    });
                }
            },
            0L,
            TimeUnit.HOURS.toMillis(12L)
        );
    }

Replace Anonymous With Lambda ch.andre601.advancedserverlist.core.check.UpdateChecker.startUpdateChecker.scheduleAtFixedRate.new TimerTask with () -> {logger.info("Checking for a new update..."); in method public startUpdateChecker() : void from class ch.andre601.advancedserverlist.core.check.UpdateChecker


    /**
     * Runs on the start of the application. Loads the scene and configures it
     * @param stage main stage
     * @throws IOException gets thrown if something fails with loading external files
     */

    @Override
    public void start(Stage stage) throws IOException {
        register = getRegisterFromSave();
        Scene scene = new Scene(loadFXML("MainApplication"), 640, 480);
        stage.setMaximized(true);
        stage.setScene(scene);
        stage.setTitle("To-Do-List 1.0");
        stage.getIcons().add(new Image(new FileInputStream("src/main/resources/Images/Logo256pxv2.png")));
        stage.show();
        stage.setOnCloseRequest(event -> {
            alertOnExit();
            event.consume();
        });
    }

    /**
     * Runs on the start of the application. Loads the scene and configures it
     * @param stage main stage
     * @throws IOException gets thrown if something fails with loading external files
     */

    @Override
    public void start(Stage stage) throws IOException {
        register = getRegisterFromSave();
        Scene scene = new Scene(loadFXML("MainApplication"), 640, 480);
        stage.setMaximized(true);
        stage.setScene(scene);
        stage.setTitle("To-Do-List 1.0");
        stage.getIcons().add(new Image(new FileInputStream("src/main/resources/Images/Logo256pxv2.png")));
        stage.show();
        stage.setOnCloseRequest(new EventHandler<WindowEvent>() {
            @Override
            public void handle(WindowEvent event) {
                alertOnExit();
                event.consume();
            }
        });
    }

Replace Anonymous With Lambda ntnu.team1.mainApplication.App.start.setOnCloseRequest.new EventHandler<WindowEvent> with event -> {alertOnExit(); in method public start(stage Stage) : void from class ntnu.team1.mainApplication.App


    /**
     * Method that gets called on load of class
     * Sets up necessary layout and configures it
     * Sets up a check and updates category list every 0.1 seconds
     * @throws IOException if the fxml file isnt found
     */

    public void initialize() throws IOException {
        pane.setOnMouseMoved(e-> generateCategoryList());
        Pane newLoadedPane = FXMLLoader.load(getClass().getResource("task/taskList.fxml"));
        view.setCenter(newLoadedPane);
        menuHelpAbout.setOnAction(showAbout());
        currentCategories = App.getRegister().getCategories();
        generateCategoryList();

        Timeline updateCategory = new Timeline(
            new KeyFrame(Duration.millis(10),
                    event -> {
                        if(App.getRegister().getCategories() != currentCategories){
                            generateCategoryList();
                        }
                    }));
        updateCategory.setCycleCount(Timeline.INDEFINITE);
        updateCategory.play();
    }

    /**
     * Method that gets called on load of class
     * Sets up necessary layout and configures it
     * Sets up a check and updates category list every 0.1 seconds
     * @throws IOException if the fxml file isnt found
     */

    public void initialize() throws IOException {
        pane.setOnMouseMoved(e-> generateCategoryList());
        Pane newLoadedPane = FXMLLoader.load(getClass().getResource("task/taskList.fxml"));
        view.setCenter(newLoadedPane);
        menuHelpAbout.setOnAction(showAbout());
        generateCategoryList();

        Timeline updateCategory = new Timeline(
            new KeyFrame(Duration.millis(100),
                    new EventHandler<>() {
                        @Override
                        public void handle(ActionEvent event) {
                            generateCategoryList();
                        }
                    }));
        updateCategory.setCycleCount(Timeline.INDEFINITE);
        updateCategory.play();
    }

Replace Anonymous With Lambda ntnu.team1.mainApplication.MainApplicationController.initialize.updateCategory.new Timeline.new KeyFrame.new EventHandler<> with event -> {if(App.getRegister().getCategories() != currentCategories){generateCategoryList(); in method public initialize() : void from class ntnu.team1.mainApplication.MainApplicationController


    /**
     * Method that gets called on load of class
     * Sets up necessary layout and configures it
     * Sets up a check and updates category list every 0.1 seconds
     * @throws IOException if the fxml file isnt found
     */

    public void initialize() throws IOException {
        pane.setOnMouseMoved(e-> generateCategoryList());
        Pane newLoadedPane = FXMLLoader.load(getClass().getResource("task/taskList.fxml"));
        view.setCenter(newLoadedPane);
        menuHelpAbout.setOnAction(showAbout());
        generateCategoryList();

        Timeline updateCategory = new Timeline(
            new KeyFrame(Duration.millis(100),
                    new EventHandler<>() {
                        @Override
                        public void handle(ActionEvent event) {
                            generateCategoryList();
                        }
                    }));
        updateCategory.setCycleCount(Timeline.INDEFINITE);
        updateCategory.play();
    }

    /**
     * Method that gets called on load of class
     * Sets up necessary layout and configures it
     * Sets up a check and updates category list every 0.1 seconds
     * @throws IOException if the fxml file isnt found
     */

    public void initialize() throws IOException {
        pane.setOnMouseMoved(e-> generateCategoryList());
        Pane newLoadedPane = FXMLLoader.load(getClass().getResource("task/taskList.fxml"));
        view.setCenter(newLoadedPane);
        menuHelpAbout.setOnAction(showAbout());
        generateCategoryList();

        Timeline updateCategory = new Timeline(
            new KeyFrame(Duration.millis(100),
            new EventHandler<ActionEvent>() {
                @Override
                public void handle(ActionEvent event) {
                    generateCategoryList();
                }
            }));
        updateCategory.setCycleCount(Timeline.INDEFINITE);
        updateCategory.play();
    }

Replace Generic With Diamond Timeline with Timeline in method public initialize() : void from class ntnu.team1.mainApplication.MainApplicationController


    @FXML
    private EventHandler<ActionEvent> showAbout() {
        return event -> {
            Alert alert = new Alert(Alert.AlertType.INFORMATION);
            alert.initModality(Modality.APPLICATION_MODAL);
            alert.setTitle("About");
            alert.setHeaderText("To-Do-List Application");
            alert.setContentText("Version 1.0\n" +
                    "Made by Team 1.1" +
                    "\n2021 \u00A9");
            alert.showAndWait();
        };
    }

    @FXML
    private EventHandler<ActionEvent> showAbout() {
        EventHandler<ActionEvent> eventHandler = new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent event) {
                Alert alert = new Alert(Alert.AlertType.INFORMATION);
                alert.initModality(Modality.APPLICATION_MODAL);
                alert.setTitle("About");
                alert.setHeaderText("To-Do-List Application");
                alert.setContentText("Version 1.0\n" +
                        "Made by Team 1.1"+
                        "\n2021 \u00A9");
                alert.showAndWait();
            }
        };
        return eventHandler;
    }

Replace Anonymous With Lambda ntnu.team1.Take2.MainApplicationController.showAbout.eventHandler.new EventHandler<ActionEvent> with event -> {Alert alert=new Alert(Alert.AlertType.INFORMATION); in method private showAbout() : EventHandler<ActionEvent> from class ntnu.team1.Take2.MainApplicationController


    @Override
    public void printErrorMessage(String message) {
        error1.setText(message);
        error1.setVisible(true);
        error2.setText(message);
        error2.setVisible(true);
        error3.setText(message);
        error3.setVisible(true);
        Timer timer = new Timer(3000, arg0 -> {
            error1.setVisible(false);
            error2.setVisible(false);
            error3.setVisible(false);
        });
        timer.setRepeats(false);
        timer.start();
    }

    @Override
    public void printErrorMessage(String message) {
        //TODO
        error1.setText(message);
        error1.setVisible(true);
        error2.setText(message);
        error2.setVisible(true);
        error3.setText(message);
        error3.setVisible(true);
        Timer timer = new Timer(3000, new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent arg0) {
                error1.setVisible(false);
                error2.setVisible(false);
                error3.setVisible(false);
            }
        });
        timer.setRepeats(false);
        timer.start();
    }

Replace Anonymous With Lambda view.MenuFrame.printErrorMessage.timer.new Timer.new ActionListener with arg0 -> {error1.setVisible(false); in method public printErrorMessage(message String) : void from class view.MenuFrame


    @Override
    public boolean load() {
        objects = new ArrayList<>();

        File file = new File(FILENAME);
        try (
                FileInputStream fileInputStream = new FileInputStream(file);
                ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream);
        ) {
            int objectAmount = objectInputStream.readInt();

            for (int i = 0; i < objectAmount; i++) {
                Album album = (Album) objectInputStream.readObject();
                album.setHoortBij(MainApplication.getArtistDAO().getById(objectInputStream.readInt()));
                addOrUpdate(album);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return super.load();
    }

    @Override
    public boolean load() {
        objects = new ArrayList<Album>();

        File file = new File(FILENAME);
        try (
                FileInputStream fileInputStream = new FileInputStream(file);
                ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream);
        ) {
            int objectAmount = objectInputStream.readInt();

            for (int i = 0; i < objectAmount; i++) {
                Album album = (Album) objectInputStream.readObject();
                album.setHoortBij(MainApplication.getArtistDAO().getById(objectInputStream.readInt()));
                addOrUpdate(album);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return super.load();
    }

Replace Generic With Diamond ArrayList<Album> with ArrayList<> in method public load() : boolean from class practicumopdracht.data.ObjectAlbumDAO


    @Override
    public boolean load() {
        checkIfFileExists(FILENAME);
        objects = new ArrayList<>();

        try (Scanner scanner = new Scanner(new File(FILENAME))) {

            while (scanner.hasNextLine()){
                String line = scanner.nextLine();
                String[] split = line.split(SPLIT_SEQUENCE);
                addOrUpdate(new Artist(split[0],split[1],Boolean.parseBoolean(split[2]),split[3]));
            }
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
        return super.load();
    }

    @Override
    public boolean load() {
        checkIfFileExists(FILENAME);
        objects = new ArrayList<Artist>();

        try (Scanner scanner = new Scanner(new File(FILENAME))) {

            while (scanner.hasNextLine()){
                String line = scanner.nextLine();
                String[] split = line.split(SPLIT_SEQUENCE);
                addOrUpdate(new Artist(split[0],split[1],Boolean.parseBoolean(split[2]),split[3]));
            }
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
        return super.load();
    }

Replace Generic With Diamond ArrayList<Artist> with ArrayList<> in method public load() : boolean from class practicumopdracht.data.TextArtistDAO


            @Override
            public ListCell<Artist> call(ListView<Artist> l) {
                return new ListCell<>() {

                    @Override
                    protected void updateItem(Artist item, boolean empty) {
                        super.updateItem(item, empty);
                        if (item == null || empty) {
                            setGraphic(null);
                        } else {
                            setText(item.getListString());
                        }
                    }
                };
            }

            @Override
            public ListCell<Artist> call(ListView<Artist> l) {
                return new ListCell<Artist>() {

                    @Override
                    protected void updateItem(Artist item, boolean empty) {
                        super.updateItem(item, empty);
                        if (item == null || empty) {
                            setGraphic(null);
                        } else {
                            setText(item.getListString());
                        }
                    }
                };
            }

Replace Generic With Diamond ListCell<Artist> with ListCell<> in method public call(l ListView<Artist>) : ListCell<Artist> from class practicumopdracht.controllers.AlbumController.setArtistComboBox.cellFactory.new Callback<>


    private void setArtistComboBox() {
        //Source:https://stackoverflow.com/a/40325634
        //required for setting the combobox button and content to the item.getListString();
        Callback<ListView<Artist>, ListCell<Artist>> cellFactory = new Callback<>() {

            @Override
            public ListCell<Artist> call(ListView<Artist> l) {
                return new ListCell<>() {

                    @Override
                    protected void updateItem(Artist item, boolean empty) {
                        super.updateItem(item, empty);
                        if (item == null || empty) {
                            setGraphic(null);
                        } else {
                            setText(item.getListString());
                        }
                    }
                };
            }
        };

        ComboBox<Artist> artistComboBox = VIEW.getArtistComboBox();
        ArrayList<Artist> artists = (ArrayList<Artist>) MainApplication.getArtistDAO().getAll();
        artistComboBox.setItems(FXCollections.observableList(artists));
        artistComboBox.getSelectionModel().select(currentArtist);
        artistComboBox.setMaxWidth(999);
        artistComboBox.setButtonCell(cellFactory.call(null));
        artistComboBox.setCellFactory(cellFactory);

        ComboBox<Artist> artistEditComboBox = VIEW.getEditArtistComboBox();
        artistEditComboBox.setItems(FXCollections.observableList(artists));
        artistEditComboBox.getSelectionModel().select(currentArtist);
        artistEditComboBox.setButtonCell(cellFactory.call(null));
        artistEditComboBox.setCellFactory(cellFactory);
    }

    private void setArtistComboBox() {
        //Source:https://stackoverflow.com/a/40325634
        //required for setting the combobox button and content to the item.getListString();
        Callback<ListView<Artist>, ListCell<Artist>> cellFactory = new Callback<ListView<Artist>, ListCell<Artist>>() {

            @Override
            public ListCell<Artist> call(ListView<Artist> l) {
                return new ListCell<Artist>() {

                    @Override
                    protected void updateItem(Artist item, boolean empty) {
                        super.updateItem(item, empty);
                        if (item == null || empty) {
                            setGraphic(null);
                        } else {
                            setText(item.getListString());
                        }
                    }
                };
            }
        };

        ComboBox artistComboBox = view.getArtistComboBox();
        ArrayList<Artist> artists = (ArrayList<Artist>) MainApplication.getArtistDAO().getAll();
        artistComboBox.setItems(FXCollections.observableList(artists));
        artistComboBox.getSelectionModel().select(currentArtist);
        artistComboBox.setMaxWidth(999);
        artistComboBox.setButtonCell(cellFactory.call(null));
        artistComboBox.setCellFactory(cellFactory);

        ComboBox artistEditComboBox = view.getEditArtistComboBox();
        artistEditComboBox.setItems(FXCollections.observableList(artists));
        artistEditComboBox.getSelectionModel().select(currentArtist);
        artistEditComboBox.setButtonCell(cellFactory.call(null));
        artistEditComboBox.setCellFactory(cellFactory);
    }

Replace Generic With Diamond ListCell<Artist> with ListCell<> in method private setArtistComboBox() : void from class practicumopdracht.controllers.AlbumController


    ZipUtil(){
        fileList = new ArrayList<>();
    }

    ZipUtil(){
        fileList = new ArrayList<String>();
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method package ZipUtil() from class org.luna.core.util.ZipUtil


	/**Receive a piece sended by a peer
	 * @param receivedMsg The message received from a peer, with
	 * a piece.*/
	private void receivePiece(final ACLMessage receivedMsg) {
		int pieceNumber;
		try {
			//X is the length of the block
			//piece msg: <len=0009+X><id=7><index><begin><block>
			byte[] pieceMsg = (byte[])receivedMsg.getContentObject();

			pieceMsg=deleteFirstFieldReceivedPieceMsg(pieceMsg, false); //len field
			pieceMsg=deleteFirstFieldReceivedPieceMsg(pieceMsg, false); //id field

			pieceNumber =
				Integer.parseInt(
					new String(getNextFieldReceivedPieceMsg(pieceMsg, false)));
			pieceMsg=deleteFirstFieldReceivedPieceMsg(pieceMsg, false);

			getNextFieldReceivedPieceMsg(pieceMsg, false); //begin field
			pieceMsg=deleteFirstFieldReceivedPieceMsg(pieceMsg, false);

			final byte[] piece = getNextFieldReceivedPieceMsg(pieceMsg, true);

			String auxBitField = dm.getRow(row).getBitField();
			auxBitField = Torrent.setBitFieldPosition(auxBitField, pieceNumber);
			dm.getRow(row).setBitField(auxBitField);
			dm.fireTableRowsUpdated(row, row);
		    dm.addDownloaded(piece.length, row);
		    dm.saveXml();
		    TorrentClientAgent a = (TorrentClientAgent)myAgent;
		    a.getGui().setMissingPiecesCountStatus();
		    long fileLength = dm.getRow(row).getFileSize();
		    int piecesCount = Torrent.numPieces(fileLength, pieceLength);
		    sf.writePiece(pieceNumber, piecesCount, piece);
		} catch(IOException | UnreadableException e) {
			JOptionPane.showMessageDialog(
				    null, e.getLocalizedMessage(),
				    "Error", JOptionPane.ERROR_MESSAGE);
			return;
		}

		System.out.println(myAgent.getLocalName() +
			": Piece " + pieceNumber + " received from " +
			receivedMsg.getSender().getLocalName());
		requestResponsesCount++;
	}

	/**Receive a piece sended by a peer
	 * @param receivedMsg The message received from a peer, with
	 * a piece.*/
	private void receivePiece(ACLMessage receivedMsg) {
		int pieceNumber;
		try {
			//X is the length of the block
			//piece msg: <len=0009+X><id=7><index><begin><block>
			byte[] pieceMsg = (byte[])receivedMsg.getContentObject();

			pieceMsg=deleteFirstFieldReceivedPieceMsg(pieceMsg, false); //len field
			pieceMsg=deleteFirstFieldReceivedPieceMsg(pieceMsg, false); //id field

			pieceNumber =
				Integer.parseInt(
					new String(getNextFieldReceivedPieceMsg(pieceMsg, false)));
			pieceMsg=deleteFirstFieldReceivedPieceMsg(pieceMsg, false);

			getNextFieldReceivedPieceMsg(pieceMsg, false); //begin field
			pieceMsg=deleteFirstFieldReceivedPieceMsg(pieceMsg, false);

			byte[] piece = getNextFieldReceivedPieceMsg(pieceMsg, true);

			String auxBitField = dm.getRow(row).getBitField();
			auxBitField = Torrent.setBitFieldPosition(auxBitField, pieceNumber);
			dm.getRow(row).setBitField(auxBitField);
			dm.fireTableRowsUpdated(row, row);
		    dm.addDownloaded(piece.length, row);
		    dm.saveXml();
		    TorrentClientAgent a = (TorrentClientAgent)myAgent;
		    a.getGui().setMissingPiecesCountStatus();
		    long fileLength = dm.getRow(row).getFileSize();
		    int piecesCount = Torrent.numPieces(fileLength, pieceLength);
		    sf.writePiece(pieceNumber, piecesCount, piece);
		} catch(IOException e) {
			JOptionPane.showMessageDialog(
				    null, e.getLocalizedMessage(),
				    "Error", JOptionPane.ERROR_MESSAGE);
			return;
		} catch (UnreadableException e) {
			JOptionPane.showMessageDialog(
				    null, e.getLocalizedMessage(),
				    "Error", JOptionPane.ERROR_MESSAGE);
			return;
		}
		System.out.println(myAgent.getLocalName() +
			": Piece " + pieceNumber + " received from " +
			receivedMsg.getSender().getLocalName());
		requestResponsesCount++;
	}

Merge Catch [catch(IOException e), catch(UnreadableException e)] to catch(IOException|UnreadableException e) in method private receivePiece(receivedMsg ACLMessage) : void from class com.manoelcampos.smatorrent.behaviours.RequestPiecesBehaviour


	/**Create a Swing JTable loading data from a XML file
	 * @see  MainForm#xmlFileName*/
	private void createTableModel() {
		try {
			dataModel = new XmlTorrentDataModel(xmlFileName);
			tb.setModel(dataModel);

			ListSelectionModel rowSM = tb.getSelectionModel();
			rowSM.addListSelectionListener(new ListSelectionListener() {
				public void valueChanged(ListSelectionEvent e) {
					tableSelectionChanged(e);
				}
			});
		} catch (ParserConfigurationException | IOException e) {
			JOptionPane.showMessageDialog(
			    this, e.getLocalizedMessage(), "Error", JOptionPane.ERROR_MESSAGE);
		}
	}

	/**Create a Swing JTable loading data from a XML file
	 * @see  MainForm#xmlFileName*/
	private void createTableModel() {
		try {
			dataModel = new XmlTorrentDataModel(xmlFileName);
			tb.setModel(dataModel);

			ListSelectionModel rowSM = tb.getSelectionModel();
			rowSM.addListSelectionListener(new ListSelectionListener() {
				public void valueChanged(ListSelectionEvent e) {
					tableSelectionChanged(e);
				}
			});
		} catch (ParserConfigurationException e) {
			JOptionPane.showMessageDialog(
			    this, e.getLocalizedMessage(), "Error", JOptionPane.ERROR_MESSAGE);
		} catch (SAXException e) {
			JOptionPane.showMessageDialog(
				this, e.getLocalizedMessage(), "Error", JOptionPane.ERROR_MESSAGE);
		} catch (IOException e) {
			JOptionPane.showMessageDialog(
				this, e.getLocalizedMessage(), "Error", JOptionPane.ERROR_MESSAGE);
		}
	}

Merge Catch [catch(ParserConfigurationException e), catch(IOException e)] to catch(ParserConfigurationException|IOException e) in method private createTableModel() : void from class com.manoelcampos.smatorrent.MainForm


    /**
     * Write a torrent file using the class's properties.
     *
     * @param torrentFileName Name of torrent file to write.
     * @throws IOException           When the file cannot be accessed
     * @throws FileNotFoundException When the file doesn't exists
     */
    public void writeToFile(String torrentFileName) throws IOException, FileNotFoundException {
        File f = new File(torrentFileName);

        Calendar cal = Calendar.getInstance();
        int year, month, day, hour, min, sec;
        year = cal.get(Calendar.YEAR);
        month = cal.get(Calendar.MONTH);
        day = cal.get(Calendar.DAY_OF_MONTH);
        hour = cal.get(Calendar.HOUR);
        min = cal.get(Calendar.MINUTE);
        sec = cal.get(Calendar.SECOND);
        //To convert date to UTC format.
        cal.set(year + 1900, month, day, hour, min, sec);
        long utcDate = cal.getTime().getTime();

        f.createNewFile();
        try(DataOutputStream os = new DataOutputStream(new FileOutputStream(f))) {
            String s;
            os.writeByte('d'); //header of file
            s = BEncode.bDictionaryStrField("announce", announce);
            os.writeBytes(s);

            s = BEncode.bDictionaryStrField("comment", comment);
            os.writeBytes(s);

            s = BEncode.bDictionaryStrField("created by", createdBy);
            os.writeBytes(s);

            s = BEncode.bDictionaryIntField("creation date", utcDate);
            os.writeBytes(s);

            if (encoding != "") {
                s = BEncode.bDictionaryStrField("encoding", encoding);
                os.writeBytes(s);
            }

            os.writeBytes("4:infod");

            s = BEncode.bDictionaryIntField("length", info.getLength());
            os.writeBytes(s);

            if (info.getMd5sum() != "") {
                s = BEncode.bDictionaryStrField("md5sum", info.getMd5sum());
                os.writeBytes(s);
            }

            s = BEncode.bDictionaryStrField("name", info.getName());
            os.writeBytes(s);

            s = BEncode.bDictionaryIntField("piece length", info.getPieceLength());
            os.writeBytes(s);

            s = BEncode.bstring("pieces");
            os.writeBytes(s);

            s = String.valueOf(info.getPieces().length);
            os.writeBytes(s + ':');
            os.write(info.getPieces());

            os.writeByte('e'); //trailling of info dictionary
            os.writeByte('e'); //trailing of file
        }
    }

	/**Write a torrent file using the class's properties.
	 * @param torrentFileName Name of torrent file to write.
	 * @throws IOException When the file cannot be accessed
	 * @throws FileNotFoundException When the file doesn't exists*/
	public void writeToFile(String torrentFileName)
	  throws IOException, FileNotFoundException {
		File f = new File(torrentFileName);

		Calendar cal = Calendar.getInstance();
		int year, month, day, hour, min, sec;
		year = cal.get(Calendar.YEAR);
		month = cal.get(Calendar.MONTH);
		day = cal.get(Calendar.DAY_OF_MONTH);
		hour = cal.get(Calendar.HOUR);
		min = cal.get(Calendar.MINUTE);
		sec = cal.get(Calendar.SECOND);
		//To convert date to UTC format.
		cal.set(year + 1900, month, day, hour, min, sec);
		long utcDate = cal.getTime().getTime();

		f.createNewFile();

		DataOutputStream os =
		 	new DataOutputStream(new FileOutputStream(f));
		try {
			String s;
			os.writeByte('d'); //header of file
			s = BEncode.bDictionaryStrField("announce", announce);
			os.writeBytes(s);

			s = BEncode.bDictionaryStrField("comment", comment);
			os.writeBytes(s);

			s  = BEncode.bDictionaryStrField("created by", createdBy);
			os.writeBytes(s);

			s=BEncode.bDictionaryIntField("creation date", utcDate);
			os.writeBytes(s);

			if(encoding != "") {
				s=BEncode.bDictionaryStrField("encoding", encoding);
				os.writeBytes(s);
			}

			os.writeBytes("4:infod");

			s=BEncode.bDictionaryIntField("length", info.getLength());
			os.writeBytes(s);

			if(info.getMd5sum() != "") {
				s=BEncode.bDictionaryStrField("md5sum", info.getMd5sum());
				os.writeBytes(s);
			}

			s=BEncode.bDictionaryStrField("name", info.getName());
			os.writeBytes(s);

			s=BEncode.bDictionaryIntField("piece length", info.getPieceLength());
			os.writeBytes(s);

			s=BEncode.bstring("pieces");
			os.writeBytes(s);

			s= String.valueOf(info.getPieces().length);
			os.writeBytes(s + ':');
			os.write(info.getPieces());

			os.writeByte('e'); //trailling of info dictionary
			os.writeByte('e'); //trailing of file
		} finally {
			os.close();
		}
	}

Try With Resources try(DataOutputStream os=new DataOutputStream(new FileOutputStream(f))) in method public writeToFile(torrentFileName String) : void from class com.manoelcampos.smatorrent.Torrent


	public boolean done() {
		//If step == -1, an error ocurred in the constructor
		boolean isDone = (step==-1) || dm.isCompleted(row);
		if(isDone) {
			System.out.println("Pieces received: " + requestResponsesCount);
			try {
			  sf.close();
			  long fileLength = dm.getRow(row).getFileSize();
			  SharedFile.reconstructFile(tmpFileName, fileLength, originalFileName);
			} catch(IOException | InvalidBEncodedStringException e) {
				JOptionPane.showMessageDialog(null,
					e.getLocalizedMessage(), "Error", JOptionPane.ERROR_MESSAGE);
			}
		}

		return isDone;
	}

	public boolean done() {
		//If step == -1, an error ocurred in the constructor
		boolean isDone = (step==-1) || dm.isCompleted(row);
		if(isDone) {
			System.out.println("Pieces received: " + requestResponsesCount);
			try {
			  sf.close();
			  long fileLength = dm.getFileSize(row);
			  SharedFile.reconstructFile(tmpFileName, fileLength, originalFileName);
			} catch(IOException e) {
				JOptionPane.showMessageDialog(null,
					e.getLocalizedMessage(), "Error", JOptionPane.ERROR_MESSAGE);
			} catch (InvalidBEncodedStringException e) {
				JOptionPane.showMessageDialog(null,
					e.getLocalizedMessage(), "Error", JOptionPane.ERROR_MESSAGE);
			}
		}
		return isDone;
	}

Merge Catch [catch(IOException e), catch(InvalidBEncodedStringException e)] to catch(IOException|InvalidBEncodedStringException e) in method public done() : boolean from class com.manoelcampos.smatorrent.behaviours.RequestPiecesBehaviour


	private List<String> allStashesInStore() {
		try {
			if (!file.exists()) return new ArrayList<>();
			List<String> result = new ArrayList<>();
			Files.walkFileTree(file.toPath(), new SimpleFileVisitor<>() {

				@Override
				public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
					if (file.toString().toLowerCase().endsWith(".stash"))
						result.add(relativePathOf(file.toUri().toURL()));
					return FileVisitResult.CONTINUE;
				}
			});
			return result;
		} catch (IOException e) {
			e.printStackTrace();
			return new ArrayList<>();
		}
	}

	private List<String> allStashesInStore() {
		try {
			if (!file.exists()) return new ArrayList<>();
			List<String> result = new ArrayList<>();
			Files.walkFileTree(file.toPath(), new SimpleFileVisitor<Path>() {

				@Override
				public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
					if (file.toString().toLowerCase().endsWith(".stash")) result.add(relativePathOf(file.toUri().toURL()));
					return FileVisitResult.CONTINUE;
				}
			});
			return result;
		} catch (IOException e) {
			e.printStackTrace();
			return new ArrayList<>();
		}
	}

Replace Generic With Diamond SimpleFileVisitor<Path> with SimpleFileVisitor<> in method private allStashesInStore() : List<String> from class io.intino.magritte.framework.stores.InMemoryFileStore


	private void afterIdentifier() {
		extend(CompletionType.BASIC, TaraFilters.afterNodeIdentifier,
				new CompletionProvider<>() {
					public void addCompletions(@NotNull CompletionParameters parameters,
											   ProcessingContext context,
											   @NotNull CompletionResultSet resultSet) {
						resultSet.addElement(create("extends "));
						resultSet.addElement(create("is "));
						resultSet.addElement(create("into "));
					}
				}
		);
	}

	private void afterIdentifier() {
		extend(CompletionType.BASIC, TaraFilters.afterNodeIdentifier,
			new CompletionProvider<CompletionParameters>() {
				public void addCompletions(@NotNull CompletionParameters parameters,
				                           ProcessingContext context,
				                           @NotNull CompletionResultSet resultSet) {
					resultSet.addElement(create("extends "));
					resultSet.addElement(create("is "));
					resultSet.addElement(create("into "));
				}
			}
		);
	}

Replace Generic With Diamond CompletionProvider<CompletionParameters> with CompletionProvider<> in method private afterIdentifier() : void from class io.intino.tara.plugin.codeinsight.completion.TaraNodeCompletionContributor


	private void parameterNames() {
		extend(CompletionType.BASIC, TaraFilters.inParameterName,
				new CompletionProvider<>() {
					public void addCompletions(@NotNull CompletionParameters parameters,
											   ProcessingContext context,
											   @NotNull CompletionResultSet resultSet) {
						if (!(parameters.getPosition().getContext() instanceof Identifier)) return;
						final CompletionUtils completionUtils = new CompletionUtils(parameters, resultSet);
						completionUtils.collectSignatureParameters();
					}
				}
		);
	}

	private void parameterNames() {
		extend(CompletionType.BASIC, TaraFilters.inParameterName,
				new CompletionProvider<CompletionParameters>() {
					public void addCompletions(@NotNull CompletionParameters parameters,
											   ProcessingContext context,
											   @NotNull CompletionResultSet resultSet) {
						if (!(parameters.getPosition().getContext() instanceof Identifier)) return;
						final CompletionUtils completionUtils = new CompletionUtils(parameters, resultSet);
						completionUtils.collectSignatureParameters();
					}
				}
		);
	}

Replace Generic With Diamond CompletionProvider<CompletionParameters> with CompletionProvider<> in method private parameterNames() : void from class io.intino.tara.plugin.codeinsight.completion.TaraNodeCompletionContributor


	private Comparator<Node> inheritanceComparator() {
		return new Comparator<>() {
			@Override
			public int compare(Node o1, Node o2) {
				return maxLevel(o1) - maxLevel(o2);
			}

			private int maxLevel(Node node) {
				List<Integer> levels = new ArrayList<>(Collections.singletonList(0));
				levels.addAll(node.children().stream().map(this::maxLevel).collect(Collectors.toList()));
				levels.sort(Collections.reverseOrder());
				return 1 + levels.get(0);
			}

			@Override
			public boolean equals(Object obj) {
				return false;
			}

			@Override
			public int hashCode() {
				return super.hashCode();
			}
		};
	}

	private Comparator<Node> inheritanceComparator() {
		return new Comparator<Node>() {
			@Override
			public int compare(Node o1, Node o2) {
				return maxLevel(o1) - maxLevel(o2);
			}

			private int maxLevel(Node node) {
				List<Integer> levels = new ArrayList<>(Collections.singletonList(0));
				levels.addAll(node.children().stream().map(this::maxLevel).collect(Collectors.toList()));
				levels.sort(Collections.reverseOrder());
				return 1 + levels.get(0);
			}

			@Override
			public boolean equals(Object obj) {
				return false;
			}

			@Override
			public int hashCode() {
				return super.hashCode();
			}
		};
	}

Replace Generic With Diamond Comparator<Node> with Comparator<> in method private inheritanceComparator() : Comparator<Node> from class io.intino.tara.compiler.dependencyresolution.InheritanceResolver


	private PsiDirectory[] createPath(final PsiFile file, final PsiDirectoryImpl srcDirectory, final String destinyName) {
		final PsiDirectory[] destiny = new PsiDirectory[1];
		WriteCommandAction.writeCommandAction(file.getProject(), file).run(() -> {
			destiny[0] = srcDirectory;
			List<String> split = Arrays.asList(destinyName.split("\\."));
			for (String subDirName : split) {
				if (destiny[0] == null) break;
				destiny[0] = destiny[0].findSubdirectory(subDirName) == null ?
						DirectoryUtil.createSubdirectories(subDirName, destiny[0], ".") :
						destiny[0].findSubdirectory(subDirName);
			}
		});
		return destiny;
	}

	private PsiDirectory[] createPath(final PsiFile file, final PsiDirectoryImpl srcDirectory, final String destinyName) {
		final PsiDirectory[] destiny = new PsiDirectory[1];
		WriteCommandAction action = new WriteCommandAction(file.getProject(), file) {
			@Override
			protected void run(@NotNull Result result) throws Throwable {
				destiny[0] = srcDirectory;
				List<String> split = Arrays.asList(destinyName.split("\\."));
				for (String subDirName : split) {
					if (destiny[0] == null) break;
					destiny[0] = destiny[0].findSubdirectory(subDirName) == null ?
						DirectoryUtil.createSubdirectories(subDirName, destiny[0], ".") :
						destiny[0].findSubdirectory(subDirName);
				}
			}
		};
		action.execute();
		return destiny;
	}

Replace Anonymous With Lambda io.intino.tara.plugin.annotator.fix.ClassCreationIntention.createPath.action.new WriteCommandAction with () -> {destiny[0]=srcDirectory; in method private createPath(file PsiFile, srcDirectory PsiDirectoryImpl, destinyName String) : PsiDirectory[] from class io.intino.tara.plugin.annotator.fix.ClassCreationIntention


		private void refreshLanguage(String moduleName) {
			Module module = ApplicationManager.getApplication().runReadAction((Computable<Module>) () -> ModuleManager.getInstance(myProject).findModuleByName(moduleName));
			final Configuration configuration = TaraUtil.configurationOf(module);
			if (configuration != null) {
				String outDSL = configuration.outDSL();
				LanguageManager.reloadLanguageForProjects(myProject, outDSL);
			}
		}

		private void refreshLanguage(String moduleName) {
			Module module = ApplicationManager.getApplication().runReadAction(new Computable<Module>() {
				@Override
				public Module compute() {
					return ModuleManager.getInstance(myProject).findModuleByName(moduleName);
				}
			});
			final Configuration configuration = TaraUtil.configurationOf(module);
			if (configuration != null) {
				String outDSL = configuration.outDSL();
				LanguageManager.reloadLanguageForProjects(myProject, outDSL);
			}
		}

Replace Anonymous With Lambda tara.intellij.project.TaraCompilerListener.FileInvalidationListener.refreshLanguage.module.runReadAction.new Computable<Module> with () -> ModuleManager.getInstance(myProject).findModuleByName(moduleName) in method private refreshLanguage(moduleName String) : void from class tara.intellij.project.TaraCompilerListener.FileInvalidationListener


	private Runnable getRunnable(final Properties reportingProperties) {
		return () -> {
			ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
			indicator.setText(PluginErrorReportSubmitterBundle.message("progress.dialog.text"));
			indicator.setIndeterminate(true);

			PivotalLoggingEventSubmitter submitter = new PivotalLoggingEventSubmitter(reportingProperties, PROJECT, TOKEN);
			submitter.submit();
		};
	}

	private Runnable getRunnable(final Properties reportingProperties) {
		return new Runnable() {
			public void run() {
				ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
				indicator.setText(PluginErrorReportSubmitterBundle.message("progress.dialog.text"));
				indicator.setIndeterminate(true);

				PivotalLoggingEventSubmitter submitter = new PivotalLoggingEventSubmitter(reportingProperties, PROJECT, TOKEN);
				submitter.submit();
			}
		};
	}

Replace Anonymous With Lambda tara.intellij.diagnostic.errorreporting.PluginErrorReportSubmitter.getRunnable.new Runnable with () -> {ProgressIndicator indicator=ProgressManager.getInstance().getProgressIndicator(); in method private getRunnable(reportingProperties Properties) : Runnable from class tara.intellij.diagnostic.errorreporting.PluginErrorReportSubmitter


	@NotNull
	public LiteralTextEscaper<? extends PsiLanguageInjectionHost> createLiteralTextEscaper() {
		return new TaraStringLiteralScaper<>((PsiLanguageInjectionHost) this);
	}

	@NotNull
	public LiteralTextEscaper<? extends PsiLanguageInjectionHost> createLiteralTextEscaper() {
		return new TaraStringLiteralScaper<PsiLanguageInjectionHost>((PsiLanguageInjectionHost) this) {
		};
	}

Replace Generic With Diamond TaraStringLiteralScaper<PsiLanguageInjectionHost> with TaraStringLiteralScaper<> in method public createLiteralTextEscaper() : LiteralTextEscaper<? extends PsiLanguageInjectionHost> from class tara.intellij.lang.psi.impl.ExpressionMixin


	public static List<Object> buildResourceValue(List<Object> values, String filePath) {
		return new ArrayList<>(values.stream().
			map(v -> BLOB_KEY + getPresentableName(new File(filePath).getName()) + v.toString()).
			collect(Collectors.toList()));
	}

	private Object buildResourceValue(List<Object> values, String filePath) {
		return new ArrayList<Object>(values.stream().
			map(v -> BLOB_KEY + getPresentableName(new File(filePath).getName()) + v.toString()).
			collect(Collectors.toList()));
	}

Replace Generic With Diamond ArrayList<Object> with ArrayList<> in method public buildResourceValue(values List<Object>, filePath String) : List<Object> from class tara.compiler.codegeneration.magritte.stash.StashHelper


    @Override
    public List<Instance> components() {
        Set<Instance> instances = new LinkedHashSet<>();
        reverseListOf(layers).forEach(l -> instances.addAll(l._components()));
        return new ArrayList<>(instances);
    }

    @Override
    public List<Instance> components() {
        Set<Instance> instances = new LinkedHashSet<>();
        for (int i = layers.size() - 1; i >= 0; i--) instances.addAll(layers.get(i)._components());
        return new ArrayList<>(instances);
    }

Replace Loop With Pipeline for(int i=layers.size() - 1; i >= 0; i--) with reverseListOf(layers).forEach(l -> instances.addAll(l._components())); in method public components() : List<Instance> from class tara.magritte.Instance


	public static boolean parseAsTree(ErrorState state, final PsiBuilder builder_, int level, final IElementType chunkType,
	                                  boolean checkBraces, final Parser parser, final Parser eatMoreCondition) {
		final LinkedList<Pair<PsiBuilder.Marker, PsiBuilder.Marker>> parenList = new LinkedList<>();
		final LinkedList<Pair<PsiBuilder.Marker, Integer>> siblingList = new LinkedList<>();
		PsiBuilder.Marker marker = null;

		final Runnable checkSiblingsRunnable = () -> {
			main:
			while (!siblingList.isEmpty()) {
				final Pair<PsiBuilder.Marker, PsiBuilder.Marker> parenPair = parenList.peek();
				final int rating = siblingList.getFirst().second;
				int count = 0;
				for (Pair<PsiBuilder.Marker, Integer> pair : siblingList) {
					if (pair.second != rating || parenPair != null && pair.first == parenPair.second) break main;
					if (++count >= MAX_CHILDREN_IN_TREE) {
						final PsiBuilder.Marker parentMarker = pair.first.precede();
						while (count-- > 0) {
							siblingList.removeFirst();
						}
						parentMarker.done(chunkType);
						siblingList.addFirst(Pair.create(parentMarker, rating + 1));
						continue main;
					}
				}
				break;
			}
		};
		boolean checkParens = state.braces != null && checkBraces;
		int totalCount = 0;
		int tokenCount = 0;
		if (checkParens) {
			int tokenIdx = -1;
			while (builder_.rawLookup(tokenIdx) == TokenType.WHITE_SPACE) tokenIdx--;
			LighterASTNode doneMarker = builder_.rawLookup(tokenIdx) == state.braces[0].getLeftBraceType() ? builder_.getLatestDoneMarker() : null;
			if (doneMarker != null && doneMarker.getStartOffset() == builder_.rawTokenTypeStart(tokenIdx) && doneMarker.getTokenType() == TokenType.ERROR_ELEMENT) {
				parenList.add(Pair.create(((PsiBuilder.Marker) doneMarker).precede(), (PsiBuilder.Marker) null));
			}
		}
		while (true) {
			final IElementType tokenType = builder_.getTokenType();
			if (checkParens && (tokenType == state.braces[0].getLeftBraceType() || tokenType == state.braces[0].getRightBraceType() && !parenList.isEmpty())) {
				if (marker != null) {
					marker.done(chunkType);
					siblingList.addFirst(Pair.create(marker, 1));
					marker = null;
					tokenCount = 0;
				}
				if (tokenType == state.braces[0].getLeftBraceType()) {
					final Pair<PsiBuilder.Marker, Integer> prev = siblingList.peek();
					parenList.addFirst(Pair.create(builder_.mark(), prev == null ? null : prev.first));
				}
				checkSiblingsRunnable.run();
				builder_.advanceLexer();
				if (tokenType == state.braces[0].getRightBraceType()) {
					final Pair<PsiBuilder.Marker, PsiBuilder.Marker> pair = parenList.removeFirst();
					pair.first.done(chunkType);
					// drop all markers inside parens
					while (!siblingList.isEmpty() && siblingList.getFirst().first != pair.second) {
						siblingList.removeFirst();
					}
					siblingList.addFirst(Pair.create(pair.first, 1));
					checkSiblingsRunnable.run();
				}
			} else {
				if (marker == null) {
					marker = builder_.mark();
				}
				final boolean result = (!parenList.isEmpty() || eatMoreCondition.parse(builder_, level + 1)) && parser.parse(builder_, level + 1);
				if (result) {
					tokenCount++;
					totalCount++;
				}
				if (!result) {
					break;
				}
			}

			if (tokenCount >= MAX_CHILDREN_IN_TREE && marker != null) {
				marker.done(chunkType);
				siblingList.addFirst(Pair.create(marker, 1));
				checkSiblingsRunnable.run();
				marker = null;
				tokenCount = 0;
			}
		}
		if (marker != null) {
			marker.drop();
		}
		for (Pair<PsiBuilder.Marker, PsiBuilder.Marker> pair : parenList) {
			pair.first.drop();
		}
		return totalCount != 0;
	}

	public static boolean parseAsTree(ErrorState state, final PsiBuilder builder_, int level, final IElementType chunkType,
	                                  boolean checkBraces, final Parser parser, final Parser eatMoreCondition) {
		final LinkedList<Pair<PsiBuilder.Marker, PsiBuilder.Marker>> parenList = new LinkedList<Pair<PsiBuilder.Marker, PsiBuilder.Marker>>();
		final LinkedList<Pair<PsiBuilder.Marker, Integer>> siblingList = new LinkedList<Pair<PsiBuilder.Marker, Integer>>();
		PsiBuilder.Marker marker = null;

		final Runnable checkSiblingsRunnable = new Runnable() {
			@Override
			public void run() {
				main:
				while (!siblingList.isEmpty()) {
					final Pair<PsiBuilder.Marker, PsiBuilder.Marker> parenPair = parenList.peek();
					final int rating = siblingList.getFirst().second;
					int count = 0;
					for (Pair<PsiBuilder.Marker, Integer> pair : siblingList) {
						if (pair.second != rating || parenPair != null && pair.first == parenPair.second) break main;
						if (++count >= MAX_CHILDREN_IN_TREE) {
							final PsiBuilder.Marker parentMarker = pair.first.precede();
							while (count-- > 0) {
								siblingList.removeFirst();
							}
							parentMarker.done(chunkType);
							siblingList.addFirst(Pair.create(parentMarker, rating + 1));
							continue main;
						}
					}
					break;
				}
			}
		};
		boolean checkParens = state.braces != null && checkBraces;
		int totalCount = 0;
		int tokenCount = 0;
		if (checkParens) {
			int tokenIdx = -1;
			while (builder_.rawLookup(tokenIdx) == TokenType.WHITE_SPACE) tokenIdx--;
			LighterASTNode doneMarker = builder_.rawLookup(tokenIdx) == state.braces[0].getLeftBraceType() ? builder_.getLatestDoneMarker() : null;
			if (doneMarker != null && doneMarker.getStartOffset() == builder_.rawTokenTypeStart(tokenIdx) && doneMarker.getTokenType() == TokenType.ERROR_ELEMENT) {
				parenList.add(Pair.create(((PsiBuilder.Marker) doneMarker).precede(), (PsiBuilder.Marker) null));
			}
		}
		while (true) {
			final IElementType tokenType = builder_.getTokenType();
			if (checkParens && (tokenType == state.braces[0].getLeftBraceType() || tokenType == state.braces[0].getRightBraceType() && !parenList.isEmpty())) {
				if (marker != null) {
					marker.done(chunkType);
					siblingList.addFirst(Pair.create(marker, 1));
					marker = null;
					tokenCount = 0;
				}
				if (tokenType == state.braces[0].getLeftBraceType()) {
					final Pair<PsiBuilder.Marker, Integer> prev = siblingList.peek();
					parenList.addFirst(Pair.create(builder_.mark(), prev == null ? null : prev.first));
				}
				checkSiblingsRunnable.run();
				builder_.advanceLexer();
				if (tokenType == state.braces[0].getRightBraceType()) {
					final Pair<PsiBuilder.Marker, PsiBuilder.Marker> pair = parenList.removeFirst();
					pair.first.done(chunkType);
					// drop all markers inside parens
					while (!siblingList.isEmpty() && siblingList.getFirst().first != pair.second) {
						siblingList.removeFirst();
					}
					siblingList.addFirst(Pair.create(pair.first, 1));
					checkSiblingsRunnable.run();
				}
			} else {
				if (marker == null) {
					marker = builder_.mark();
				}
				final boolean result = (!parenList.isEmpty() || eatMoreCondition.parse(builder_, level + 1)) && parser.parse(builder_, level + 1);
				if (result) {
					tokenCount++;
					totalCount++;
				}
				if (!result) {
					break;
				}
			}

			if (tokenCount >= MAX_CHILDREN_IN_TREE && marker != null) {
				marker.done(chunkType);
				siblingList.addFirst(Pair.create(marker, 1));
				checkSiblingsRunnable.run();
				marker = null;
				tokenCount = 0;
			}
		}
		if (marker != null) {
			marker.drop();
		}
		for (Pair<PsiBuilder.Marker, PsiBuilder.Marker> pair : parenList) {
			pair.first.drop();
		}
		return totalCount != 0;
	}

Replace Anonymous With Lambda tara.intellij.lang.parser.GeneratedParserUtilBase.parseAsTree.checkSiblingsRunnable.new Runnable with () -> {mainwhile(!siblingList.isEmpty()){final Pair<PsiBuilder.Marker,PsiBuilder.Marker> parenPair=parenList.peek(); in method public parseAsTree(state ErrorState, builder_ PsiBuilder, level int, chunkType IElementType, checkBraces boolean, parser Parser, eatMoreCondition Parser) : boolean from class tara.intellij.lang.parser.GeneratedParserUtilBase


	@NotNull
	@Override
	public Runnable processFile(final PsiFile file) {
		return () -> {
			if (file instanceof TaraModel) new ImportsOptimizer((TaraModel) file).run();
		};
	}

	@NotNull
	@Override
	public Runnable processFile(final PsiFile file) {
		return new Runnable() {
			@Override
			public void run() {
				if (file instanceof TaraModel) new ImportsOptimizer((TaraModel) file).run();
			}
		};
	}

Replace Anonymous With Lambda tara.intellij.codeinsight.imports.TaraImportOptimizer.processFile.new Runnable with () -> {if(file instanceof TaraModel)new ImportsOptimizer((TaraModel)file).run(); in method public processFile(file PsiFile) : Runnable from class tara.intellij.codeinsight.imports.TaraImportOptimizer


	@NotNull
	public List<Block> getSubBlocks() {
		if (subBlocks == null) subBlocks = buildSubBlocks();
		return new ArrayList<>(subBlocks);
	}

	@NotNull
	public List<Block> getSubBlocks() {
		if (subBlocks == null) subBlocks = buildSubBlocks();
		return new ArrayList<Block>(subBlocks);
	}

Replace Generic With Diamond ArrayList<Block> with ArrayList<> in method public getSubBlocks() : List<Block> from class tara.intellij.formatter.TaraBlock


    @Override
    public Reference uid() {
        return () -> path;
    }

	@Override
	public Reference uid() {
		return new Reference() {
			@Override
			public String value() {
				return path;
			}
		};
	}

Replace Anonymous With Lambda magritte.sources.BoxSource.uid.new Reference with () -> path in method public uid() : Reference from class siani.tara.magritte.sources.BoxSource


	@NotNull
	@Override
	public Set<Class> getArgumentListAllowedParentClasses() {
		return new HashSet<>(Collections.singletonList(Signature.class));
	}

	@NotNull
	@Override
	public Set<Class> getArgumentListAllowedParentClasses() {
		return new HashSet<Class>(Arrays.asList(Signature.class));
	}

Replace Generic With Diamond HashSet<Class> with HashSet<> in method public getArgumentListAllowedParentClasses() : Set<Class> from class siani.tara.intellij.codeinsight.parameterinfo.TaraParameterInfoHandler


	@NotNull
	public static List<UsageInfo> findUsages(@NotNull PsiNamedElement element, boolean forHighlightUsages) {
		final List<UsageInfo> usages = new ArrayList<>();
		final FindUsagesHandler handler = new TaraFindUsagesHandlerFactory().createFindUsagesHandler(element, forHighlightUsages);
		assert handler != null;
		final List<PsiElement> elementsToProcess = new ArrayList<>();
		elementsToProcess.addAll(Arrays.asList(handler.getPrimaryElements()));
		elementsToProcess.addAll(Arrays.asList(handler.getSecondaryElements()));
		for (PsiElement e : elementsToProcess)
			handler.processElementUsages(e, usageInfo -> {
				if (!usageInfo.isNonCodeUsage)
					usages.add(usageInfo);
				return true;
			}, FindUsagesHandler.createFindUsagesOptions(element.getProject(), null));
		return usages;
	}

	@NotNull
	public static List<UsageInfo> findUsages(@NotNull PsiNamedElement element, boolean forHighlightUsages) {
		final List<UsageInfo> usages = new ArrayList<>();
		final FindUsagesHandler handler = new TaraFindUsagesHandlerFactory().createFindUsagesHandler(element, forHighlightUsages);
		assert handler != null;
		final List<PsiElement> elementsToProcess = new ArrayList<>();
		elementsToProcess.addAll(Arrays.asList(handler.getPrimaryElements()));
		elementsToProcess.addAll(Arrays.asList(handler.getSecondaryElements()));
		for (PsiElement e : elementsToProcess)
			handler.processElementUsages(e, new Processor<UsageInfo>() {
				@Override
				public boolean process(UsageInfo usageInfo) {
					if (!usageInfo.isNonCodeUsage)
						usages.add(usageInfo);
					return true;
				}
			}, FindUsagesHandler.createFindUsagesOptions(element.getProject(), null));
		return usages;
	}

Replace Anonymous With Lambda siani.tara.intellij.refactoring.TaraRefactoringUtil.findUsages.processElementUsages.new Processor<UsageInfo> with usageInfo -> {if(!usageInfo.isNonCodeUsage)usages.add(usageInfo); in method public findUsages(element PsiNamedElement, forHighlightUsages boolean) : List<UsageInfo> from class siani.tara.intellij.refactoring.TaraRefactoringUtil


	private List<String> splitAndTrim(String compiled) {
		return ContainerUtil.map(StringUtil.split(compiled, TaraRtConstants.SEPARATOR), String::trim);
	}

	private List<String> splitAndTrim(String compiled) {
		return ContainerUtil.map(StringUtil.split(compiled, TaraRtConstants.SEPARATOR), new Function<String, String>() {
			public String fun(String s) {
				return s.trim();
			}
		});
	}

Replace Anonymous With Lambda org.jetbrains.jps.tara.compiler.TaracOSProcessHandler.splitAndTrim.map.new Function<String,String> with String::trim in method private splitAndTrim(compiled String) : List<String> from class org.jetbrains.jps.tara.compiler.TaracOSProcessHandler


		public Map.Entry<Long, Class<?>> add(Class<?> metric, Long date) {
			return metrics.put(metric.getSimpleName(), new AbstractMap.SimpleEntry<>(date, metric));
		}

		public Map.Entry<Long, Class<?>> add(Class<?> metric, Long date) {
			return metrics.put(metric.getSimpleName(), new AbstractMap.SimpleEntry<Long, Class<?>>(date, metric));
		}

Replace Generic With Diamond AbstractMap.SimpleEntry<Long,Class<?>> with AbstractMap.SimpleEntry<> in method public add(metric Class<?>, date Long) : Map.Entry<Long,Class<?>> from class siani.tara.intellij.annotator.semanticanalizer.MetricClassCreationAnalyzer.Metrics


	private Collection<VirtualFile> projectModulePom(final Module module) {
		final PsiFile[] file = new PsiFile[1];
		ApplicationManager.getApplication().runWriteAction(() -> {
			MavenProject project = MavenProjectsManager.getInstance(module.getProject()).findProject(module);
			if (project == null) {
				PsiDirectory root = getModuleRoot(module);
				file[0] = findPom(root);
				file[0] = root.createFile(POM_XML);
				createPom(file[0].getVirtualFile().getPath(), ModulePomTemplate.create().format(createModuleFrame(module)));
			} else updateModulePom(project);
		});
		return new ArrayList<VirtualFile>() {{
			add(file[0].getVirtualFile());
		}};
	}

	private Collection<VirtualFile> projectModulePom(final Module module) {
		final PsiFile[] file = new PsiFile[1];
		ApplicationManager.getApplication().runWriteAction(new Runnable() {
			@Override
			public void run() {
				MavenProject project = MavenProjectsManager.getInstance(module.getProject()).findProject(module);
				if (project == null) {
					PsiDirectory root = getModuleRoot(module);
					file[0] = findPom(root);
					file[0] = root.createFile(POM_XML);
					createPom(file[0].getVirtualFile().getPath(), ModulePomTemplate.create().format(createModuleFrame(module)));
				} else updateModulePom(project);
			}
		});
		return new ArrayList<VirtualFile>() {{
			add(file[0].getVirtualFile());
		}};
	}

Replace Anonymous With Lambda siani.tara.intellij.framework.MavenManager.projectModulePom.runWriteAction.new Runnable with () -> {MavenProject project=MavenProjectsManager.getInstance(module.getProject()).findProject(module); in method private projectModulePom(module Module) : Collection<VirtualFile> from class siani.tara.intellij.framework.MavenManager


	private List<List<Node>> groupByBox(Model model) {
		Map<String, List<Node>> nodes = new HashMap();
		for (Node node : model.getIncludedNodes()) {
			if (!nodes.containsKey(((Element) node).getFile()))
				nodes.put(((Element) node).getFile(), new ArrayList<>());
			nodes.get(((Element) node).getFile()).add(node);
		}
		return pack(nodes);
	}

	private List<List<Node>> groupByBox(Model model) {
		Map<String, List<Node>> nodes = new HashMap();
		for (Node node : model.getIncludedNodes()) {
			if (!nodes.containsKey(((Element) node).getFile()))
				nodes.put(((Element) node).getFile(), new ArrayList<Node>());
			nodes.get(((Element) node).getFile()).add(node);
		}
		return pack(nodes);
	}

Replace Generic With Diamond ArrayList<Node> with ArrayList<> in method private groupByBox(model Model) : List<List<Node>> from class siani.tara.compiler.core.operation.ModelToJavaOperation


	public static Formatter reference() {
		return value -> {
			String val = value.toString();
			if (!val.contains(DOT)) return val.substring(0, 1).toUpperCase() + val.substring(1);
			return val;
		};
	}

	public static Formatter reference() {
		return new Formatter() {
			@Override
			public Object format(Object value) {
				java.lang.String val = value.toString();
				if (!val.contains(DOT)) return val.substring(0, 1).toUpperCase() + val.substring(1);
				return val;
			}
		};
	}

Replace Anonymous With Lambda siani.tara.compiler.codegeneration.Format.reference.new Formatter with value -> {String val=value.toString(); in method public reference() : Formatter from class siani.tara.compiler.codegeneration.Format


	public static Formatter toCamelCase() {
		return s -> {
			final String value = s.toString();
			String[] parts = value.split("_");
			if (parts.length == 1) return value.substring(0, 1).toUpperCase() + value.substring(1);
			String caseString = "";
			for (String part : parts)
				caseString = caseString + toProperCase(part);
			return caseString;
		};
	}

	public static Formatter toCamelCase() {
		return new Formatter() {
			@Override
			public Object format(Object s) {
				final String value = s.toString();
				String[] parts = value.split("_");
				if (parts.length == 1) return value.substring(0, 1).toUpperCase() + value.substring(1);
				String caseString = "";
				for (String part : parts)
					caseString = caseString + toProperCase(part);
				return caseString;
			}
		};
	}

Replace Anonymous With Lambda siani.tara.compiler.codegeneration.Format.toCamelCase.new Formatter with s -> {final String value=s.toString(); in method public toCamelCase() : Formatter from class siani.tara.compiler.codegeneration.Format


	public static Formatter date() {
		return value -> {
			String val = value.toString();
			if (!val.contains("/")) return value;
			return val.replace("/", ", ");
		};
	}

	public static Formatter date() {
		return new Formatter() {
			@Override
			public Object format(Object value) {
				java.lang.String val = value.toString();
				if (!val.contains("/")) return value;
				return val.replace("/", ", ");
			}
		};
	}

Replace Anonymous With Lambda siani.tara.compiler.codegeneration.Format.date.new Formatter with value -> {String val=value.toString(); in method public date() : Formatter from class siani.tara.compiler.codegeneration.Format


	@SuppressWarnings("ConstantConditions")
	public void navigate() {
		final FileEditorManagerEx fileEditorManager = FileEditorManagerEx.getInstanceEx(myProject);
		final FileEditor[] editors = fileEditorManager.getEditors(myNewVirtualFile);
		if (editors.length == 0) {
			final EditorWindow curWindow = fileEditorManager.getCurrentWindow();
			mySplittedWindow = curWindow.split(SwingConstants.HORIZONTAL, false, myNewVirtualFile, true);
		}
		PsiMethod executeMethod = getExecuteMethod();
		int offset = isWellBuilt(executeMethod) ? 0 : executeMethod.getBody().getFirstBodyElement().getTextOffset();
		Editor editor = fileEditorManager.openTextEditor(new OpenFileDescriptor(myProject, myNewVirtualFile, offset + 2), true);
		if (editor != null) {
			editor.putUserData(QUICK_EDIT_HANDLER, this);
			final FoldingModel foldingModel = editor.getFoldingModel();
			foldingModel.runBatchFoldingOperation(() -> {
				for (RangeMarker o : ContainerUtil.reverse(((DocumentEx) myNewDocument).getGuardedBlocks())) {
					String replacement = o.getUserData(REPLACEMENT_KEY);
					if (StringUtil.isEmpty(replacement)) continue;
					FoldRegion region = foldingModel.addFoldRegion(o.getStartOffset(), o.getEndOffset(), replacement);
					if (region != null) region.setExpanded(false);
				}
			});
		}
		SwingUtilities.invokeLater(() -> myEditor.getScrollingModel().scrollToCaret(ScrollType.MAKE_VISIBLE));

	}

	@SuppressWarnings("ConstantConditions")
	public void navigate() {
		final FileEditorManagerEx fileEditorManager = FileEditorManagerEx.getInstanceEx(myProject);
		final FileEditor[] editors = fileEditorManager.getEditors(myNewVirtualFile);
		if (editors.length == 0) {
			final EditorWindow curWindow = fileEditorManager.getCurrentWindow();
			mySplittedWindow = curWindow.split(SwingConstants.HORIZONTAL, false, myNewVirtualFile, true);
		}
		PsiMethod executeMethod = getExecuteMethod();
		int offset = isWellBuilt(executeMethod) ? 0 : executeMethod.getBody().getFirstBodyElement().getTextOffset();
		Editor editor = fileEditorManager.openTextEditor(new OpenFileDescriptor(myProject, myNewVirtualFile, offset + 2), true);
		if (editor != null) {
			editor.putUserData(QUICK_EDIT_HANDLER, this);
			final FoldingModel foldingModel = editor.getFoldingModel();
			foldingModel.runBatchFoldingOperation(new Runnable() {
				@Override
				public void run() {
					for (RangeMarker o : ContainerUtil.reverse(((DocumentEx) myNewDocument).getGuardedBlocks())) {
						String replacement = o.getUserData(REPLACEMENT_KEY);
						if (StringUtil.isEmpty(replacement)) continue;
						FoldRegion region = foldingModel.addFoldRegion(o.getStartOffset(), o.getEndOffset(), replacement);
						if (region != null) region.setExpanded(false);
					}
				}
			});
		}
		SwingUtilities.invokeLater(new Runnable() {
			@Override
			public void run() {
				myEditor.getScrollingModel().scrollToCaret(ScrollType.MAKE_VISIBLE);
			}
		});

	}

Replace Anonymous With Lambda siani.tara.intellij.codeinsight.intentions.TaraQuickEditHandler.navigate.runBatchFoldingOperation.new Runnable with () -> {for(RangeMarker o: ContainerUtil.reverse(((DocumentEx)myNewDocument).getGuardedBlocks())){String replacement=o.getUserData(REPLACEMENT_KEY); in method public navigate() : void from class siani.tara.intellij.codeinsight.intentions.TaraQuickEditHandler


	protected TaracOSProcessHandler runTaraCompiler(final CompileContext context,
	                                                final JpsTaraSettings settings, boolean pluginGeneration) throws IOException {
		List<String> classpath = new ArrayList<>(generateRunnerClasspath());
		if (LOG.isDebugEnabled()) LOG.debug("Tarac classpath: " + classpath);
		List<String> programParams = ContainerUtilRt.newArrayList(pluginGeneration ? "--gen-plugin" : "tarac", argsFile.getPath());
		List<String> vmParams = ContainerUtilRt.newArrayList();
		vmParams.add("-Xmx" + settings.heapSize + "m");
		vmParams.add("-Dfile.encoding=" + System.getProperty("file.encoding"));
		final List<String> cmd = ExternalProcessUtil.buildJavaCommandLine(
			getJavaExecutable(), "siani.tara.TaracRunner", Collections.<String>emptyList(), classpath, vmParams, programParams);
		final Process process = Runtime.getRuntime().exec(ArrayUtil.toStringArray(cmd));
		final Consumer<String> updater = s -> context.processMessage(new ProgressMessage(s));
		final TaracOSProcessHandler handler = new TaracOSProcessHandler(process, updater) {
			@Override
			protected Future<?> executeOnPooledThread(Runnable task) {
				return SharedThreadPool.getInstance().executeOnPooledThread(task);
			}
		};
		handler.startNotify();
		handler.waitFor();
		return handler;
	}

	protected TaracOSProcessHandler runTaraCompiler(final CompileContext context,
	                                                final JpsTaraSettings settings, boolean pluginGeneration) throws IOException {
		List<String> classpath = new ArrayList<>(generateRunnerClasspath());
		if (LOG.isDebugEnabled()) LOG.debug("Tarac classpath: " + classpath);
		List<String> programParams = ContainerUtilRt.newArrayList(pluginGeneration ? "--gen-plugin" : "tarac", argsFile.getPath());
		List<String> vmParams = ContainerUtilRt.newArrayList();
		vmParams.add("-Xmx" + settings.heapSize + "m");
		vmParams.add("-Dfile.encoding=" + System.getProperty("file.encoding"));
		final List<String> cmd = ExternalProcessUtil.buildJavaCommandLine(
			getJavaExecutable(), "siani.tara.TaracRunner", Collections.<String>emptyList(), classpath, vmParams, programParams);
		final Process process = Runtime.getRuntime().exec(ArrayUtil.toStringArray(cmd));
		final Consumer<String> updater = new Consumer<String>() {
			public void consume(String s) {
				context.processMessage(new ProgressMessage(s));
			}
		};
		final TaracOSProcessHandler handler = new TaracOSProcessHandler(process, updater) {
			@Override
			protected Future<?> executeOnPooledThread(Runnable task) {
				return SharedThreadPool.getInstance().executeOnPooledThread(task);
			}
		};
		handler.startNotify();
		handler.waitFor();
		return handler;
	}

Replace Anonymous With Lambda org.jetbrains.jps.tara.compiler.TaraRunner.runTaraCompiler.updater.new Consumer<String> with s -> context.processMessage(new ProgressMessage(s)) in method protected runTaraCompiler(context CompileContext, settings JpsTaraSettings, pluginGeneration boolean) : TaracOSProcessHandler from class org.jetbrains.jps.tara.compiler.TaraRunner


	private Constraint.Require parentConstraint() {
		return element -> {
			Node node = (Node) element;
			if (node.parent() == null) return;
			String parentType = node.parent().type();
			if (!parentType.equals(node.type()))
				throw new SemanticException(new SemanticError("reject.parent.different.type", node, asList(parentType, node.type())));
		};
	}

	private Constraint parentConstraint() {
		return new Constraint.Require() {
			@Override
			public void check(Element element) throws SemanticException {
				Node node = (Node) element;
				if (node.parent() == null) return;
				String parentType = node.parent().type();
				if (!parentType.equals(node.type()))
					throw new SemanticException(new SemanticError("reject.parent.different.type", node, new Object[]{parentType, node.type()}));
			}
		};
	}

Replace Anonymous With Lambda siani.tara.semantic.constraints.GlobalConstraints.parentConstraint.new Constraint.Require with element -> {Node node=(Node)element; in method private parentConstraint() : Constraint.Require from class siani.tara.semantic.constraints.GlobalConstraints


	private Constraint.Require duplicatedAnnotations() {
		return element -> {
			Node node = (Node) element;
			Set<String> annotations = new HashSet<>();
			for (String annotation : node.annotations()) {
				if (annotations.add(annotation)) continue;
				throw new SemanticException(new SemanticError("reject.duplicate.annotation", node, asList(annotation, node.type())));
			}
		};
	}

	private Constraint duplicatedAnnotations() {
		return new Constraint.Require() {
			@Override
			public void check(Element element) throws SemanticException {
				Node node = (Node) element;
				Set<String> annotations = new HashSet<>();
				for (String annotation : node.annotations()) {
					if (annotations.add(annotation)) continue;
					throw new SemanticException(new SemanticError("reject.duplicate.annotation", node, new Object[]{annotation, node.type()}));
				}
			}
		};
	}

Replace Anonymous With Lambda siani.tara.semantic.constraints.GlobalConstraints.duplicatedAnnotations.new Constraint.Require with element -> {Node node=(Node)element; in method private duplicatedAnnotations() : Constraint.Require from class siani.tara.semantic.constraints.GlobalConstraints


	private Constraint.Require duplicatedFlags() {
		return element -> {
			Node node = (Node) element;
			Set<String> flags = new HashSet<>();
			for (String flag : node.flags()) {
				if (flags.add(flag)) continue;
				throw new SemanticException(new SemanticError("reject.duplicate.flag", node, asList(flag, node.type())));
			}
		};
	}

	private Constraint duplicatedFlags() {
		return new Constraint.Require() {
			@Override
			public void check(Element element) throws SemanticException {
				Node node = (Node) element;
				Set<String> flags = new HashSet<>();
				for (String flag : node.flags()) {
					if (flags.add(flag)) continue;
					throw new SemanticException(new SemanticError("reject.duplicate.flag", node, new Object[]{flag, node.type()}));
				}
			}
		};
	}

Replace Anonymous With Lambda siani.tara.semantic.constraints.GlobalConstraints.duplicatedFlags.new Constraint.Require with element -> {Node node=(Node)element; in method private duplicatedFlags() : Constraint.Require from class siani.tara.semantic.constraints.GlobalConstraints


	private Constraint.Require flagsCoherence() {
		return element -> {
			Node node = (Node) element;
			for (String flags : node.flags())
				checkFlagConstrains(flags, node);
		};
	}

	private Constraint flagsCoherence() {
		return new Constraint.Require() {
			@Override
			public void check(Element element) throws SemanticException {
				Node node = (Node) element;
				for (String flags : node.flags())
					checkFlagConstrains(flags, node);
			}
		};
	}

Replace Anonymous With Lambda siani.tara.semantic.constraints.GlobalConstraints.flagsCoherence.new Constraint.Require with element -> {Node node=(Node)element; in method private flagsCoherence() : Constraint.Require from class siani.tara.semantic.constraints.GlobalConstraints


	private Constraint.Require duplicateNode() {
		return element -> {
			Node node = (Node) element;
			Set<String> nodeNames = new HashSet<String>() {
				@Override
				public boolean add(String name) {
					return name.isEmpty() || super.add(name);
				}
			};
			for (Node include : node.includes()) {
				if (nodeNames.add(include.name())) continue;
				throw new SemanticException(new SemanticError("reject.duplicate.entries", include, asList(include.name(), node.type().isEmpty() ? "model" : node.name())));
			}
		};
	}

	private Constraint duplicateNode() {
		return new Constraint.Require() {
			@Override
			public void check(Element element) throws SemanticException {
				Node node = (Node) element;
				Set<String> nodeNames = new HashSet<String>() {
					@Override
					public boolean add(String name) {
						return name.isEmpty() || super.add(name);
					}
				};
				for (Node include : node.includes()) {
					if (nodeNames.add(include.name())) continue;
					throw new SemanticException(new SemanticError("reject.duplicate.entries", include, new String[]{include.name(), node.type().isEmpty() ? "model" : node.name()}));
				}
			}
		};
	}

Replace Anonymous With Lambda siani.tara.semantic.constraints.GlobalConstraints.duplicateNode.new Constraint.Require with element -> {Node node=(Node)element; in method private duplicateNode() : Constraint.Require from class siani.tara.semantic.constraints.GlobalConstraints


	private Constraint.Require duplicateVariable() {
		return element -> {
			Node node = (Node) element;
			Set<String> varNames = new HashSet<String>() {
				@Override
				public boolean add(String name) {
					return name == null || name.isEmpty() || super.add(name);
				}
			};
			for (Variable variable : node.variables()) {
				if (varNames.add(variable.name())) continue;
				throw new SemanticException(new SemanticError("reject.duplicate.variable", element, asList(variable.name(), node.name())));
			}
		};
	}

	private Constraint duplicateVariable() {
		return new Constraint.Require() {
			@Override
			public void check(Element element) throws SemanticException {
				Node node = (Node) element;
				Set<String> varNames = new HashSet<String>() {
					@Override
					public boolean add(String name) {
						return name == null || name.isEmpty() || super.add(name);
					}
				};
				for (Variable variable : node.variables()) {
					if (varNames.add(variable.name())) continue;
					throw new SemanticException(new SemanticError("reject.duplicate.variable", variable.name(), node.name()));
				}
			}
		};
	}

Replace Anonymous With Lambda siani.tara.semantic.constraints.GlobalConstraints.duplicateVariable.new Constraint.Require with element -> {Node node=(Node)element; in method private duplicateVariable() : Constraint.Require from class siani.tara.semantic.constraints.GlobalConstraints


	private Constraint.Require facetInstantiation() {
		return element -> {
			Node node = (Node) element;
			Context context = rulesCatalog.get(node.type());
			if (context == null) return;
			for (Assumption assumption : context.assumptions()) {
				if (assumption instanceof Assumption.FacetInstance)
					throw new SemanticException(new SemanticError("reject.facet.as.primary", node));
			}
		};
	}

	private Constraint facetInstantiation() {
		return new Constraint.Require() {
			@Override
			public void check(Element element) throws SemanticException {
				Node node = (Node) element;
				Context context = rulesCatalog.get(node.type());
				if (context == null) return;
				for (Assumption assumption : context.assumptions()) {
					if (assumption instanceof Assumption.FacetInstance)
						throw new SemanticException(new SemanticError("reject.facet.as.primary", node, new Object[0]));
				}
			}
		};
	}

Replace Anonymous With Lambda siani.tara.semantic.constraints.GlobalConstraints.facetInstantiation.new Constraint.Require with element -> {Node node=(Node)element; in method private facetInstantiation() : Constraint.Require from class siani.tara.semantic.constraints.GlobalConstraints


	public static Allow.Name name() {
		return (element, rejectables) -> {
			List<Rejectable> toRemove = new ArrayList<>();
			for (Rejectable rejectable : rejectables) {
				if (!(rejectable instanceof Rejectable.Name)) continue;
				toRemove.add(rejectable);
			}
			rejectables.removeAll(toRemove);
		};
	}

	public static Allow.Name name() {
		return new Allow.Name() {
			@Override
			public void check(Element element, List<? extends Rejectable> rejectables) {
				List<Rejectable> toRemove = new ArrayList<>();
				for (Rejectable rejectable : rejectables) {
					if (!(rejectable instanceof Rejectable.Name)) continue;
					toRemove.add(rejectable);
				}
				rejectables.removeAll(toRemove);
			}
		};
	}

Replace Anonymous With Lambda siani.tara.semantic.constraints.RuleFactory.name.new Allow.Name with (element, rejectables) -> {List<Rejectable> toRemove=new ArrayList<>(); in method public name() : Allow.Name from class siani.tara.semantic.constraints.RuleFactory


	protected Transaction in(final String qualifiedName) {
		return context -> {
			context.commit();
			rulesCatalog.put(qualifiedName, context);
		};
	}

	protected Transaction in(final String qualifiedName) {
		return new Transaction() {
			@Override
			public void def(Context context) {
				context.commit();
				rulesCatalog.put(qualifiedName, context);
			}
		};
	}

Replace Anonymous With Lambda siani.tara.semantic.model.Tara.in.new Transaction with context -> {context.commit(); in method protected in(qualifiedName String) : Transaction from class siani.tara.semantic.model.Tara


		@NotNull
		@Override
		public List<String> getMethodTypes(NavigatablePsiElement method) {
			if (method == null) return Collections.emptyList();
			Method delegate = ((MyElement<Method>) method).myDelegate;
			Type[] parameterTypes = delegate.getGenericParameterTypes();
			ArrayList<String> result = new ArrayList<>(parameterTypes.length + 1);
			result.add(delegate.getGenericReturnType().toString());
			int paramCounter = 0;
			for (Type parameterType : parameterTypes) {
				result.add(parameterType.toString());
				result.add("p" + (paramCounter++));
			}
			return result;
		}

		@NotNull
		@Override
		public List<String> getMethodTypes(NavigatablePsiElement method) {
			if (method == null) return Collections.emptyList();
			Method delegate = ((MyElement<Method>) method).myDelegate;
			Type[] parameterTypes = delegate.getGenericParameterTypes();
			ArrayList<String> result = new ArrayList<String>(parameterTypes.length + 1);
			result.add(delegate.getGenericReturnType().toString());
			int paramCounter = 0;
			for (Type parameterType : parameterTypes) {
				result.add(parameterType.toString());
				result.add("p" + (paramCounter++));
			}
			return result;
		}

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public getMethodTypes(method NavigatablePsiElement) : List<String> from class siani.tara.intellij.codeinsight.JavaHelper.ReflectionHelper


		@NotNull
		@Override
		public List<String> getAnnotations(NavigatablePsiElement element) {
			if (element == null) return Collections.emptyList();
			AnnotatedElement delegate = ((MyElement<AnnotatedElement>) element).myDelegate;
			Annotation[] annotations = delegate.getDeclaredAnnotations();
			ArrayList<String> result = new ArrayList<>(annotations.length);
			for (Annotation annotation : annotations) {
				Class<? extends Annotation> annotationType = annotation.annotationType();
				result.add(annotationType.getCanonicalName());
			}
			return result;
		}

		@NotNull
		@Override
		public List<String> getAnnotations(NavigatablePsiElement element) {
			if (element == null) return Collections.emptyList();
			AnnotatedElement delegate = ((MyElement<AnnotatedElement>) element).myDelegate;
			Annotation[] annotations = delegate.getDeclaredAnnotations();
			ArrayList<String> result = new ArrayList<String>(annotations.length);
			for (Annotation annotation : annotations) {
				Class<? extends Annotation> annotationType = annotation.annotationType();
				result.add(annotationType.getCanonicalName());
			}
			return result;
		}

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public getAnnotations(element NavigatablePsiElement) : List<String> from class siani.tara.intellij.codeinsight.JavaHelper.ReflectionHelper


	private static PsiNamedElement addToFile(@NotNull PsiNamedElement element, @NotNull final TaraBoxFile destination, @NotNull Collection<UsageInfo> usages) {
		List<PsiElement> topLevelAtDestination = new ArrayList<>();
		for (UsageInfo usage : usages) {
			final PsiElement e = usage.getElement();
//			if (e != null && ScopeUtil.getScopeOwner(e) == destination && getImportStatementByElement(e) == null) {
//				PsiElement topLevel = PsiTreeUtil.findFirstParent(e, new Condition<PsiElement>() {
//					public boolean value(PsiElement element) {
//						return element.getParent() == destination;
//					}
//				});
//				if (topLevel != null) {
//					topLevelAtDestination.add(topLevel);
//				}
//			}
		}
		if (topLevelAtDestination.isEmpty()) {
			return (PsiNamedElement) (destination.add(element));
		} else {
			Collections.sort(topLevelAtDestination, new Comparator<PsiElement>() {
				@Override
				public int compare(PsiElement e1, PsiElement e2) {
					return PsiUtilCore.compareElementsByPosition(e1, e2);
				}

				;
			});
			final PsiElement firstUsage = topLevelAtDestination.get(0);
			return (PsiNamedElement) destination.addBefore(element, firstUsage);
		}
	}

	private static PsiNamedElement addToFile(@NotNull PsiNamedElement element, @NotNull final TaraBoxFile destination, @NotNull Collection<UsageInfo> usages) {
		List<PsiElement> topLevelAtDestination = new ArrayList<PsiElement>();
		for (UsageInfo usage : usages) {
			final PsiElement e = usage.getElement();
//			if (e != null && ScopeUtil.getScopeOwner(e) == destination && getImportStatementByElement(e) == null) {
//				PsiElement topLevel = PsiTreeUtil.findFirstParent(e, new Condition<PsiElement>() {
//					public boolean value(PsiElement element) {
//						return element.getParent() == destination;
//					}
//				});
//				if (topLevel != null) {
//					topLevelAtDestination.add(topLevel);
//				}
//			}
		}
		if (topLevelAtDestination.isEmpty()) {
			return (PsiNamedElement) (destination.add(element));
		} else {
			Collections.sort(topLevelAtDestination, new Comparator<PsiElement>() {
				@Override
				public int compare(PsiElement e1, PsiElement e2) {
					return PsiUtilCore.compareElementsByPosition(e1, e2);
				}

				;
			});
			final PsiElement firstUsage = topLevelAtDestination.get(0);
			return (PsiNamedElement) destination.addBefore(element, firstUsage);
		}
	}

Replace Generic With Diamond ArrayList<PsiElement> with ArrayList<> in method private addToFile(element PsiNamedElement, destination TaraBoxFile, usages Collection<UsageInfo>) : PsiNamedElement from class siani.tara.intellij.refactoring.move.TaraMoveConceptProcessor


	@NotNull
	@Override
	public Collection<File> getOutputRoots(CompileContext context) {
		final Set<File> result = new THashSet<>(FileUtil.FILE_HASHING_STRATEGY);
		final File moduleOutput = getModuleOutputDir();
		for (TaraConfiguration resConfig : getRootConfigurations(context.getProjectDescriptor().dataManager.getDataPaths())) {
			final File output = getOutputDir(moduleOutput, resConfig);
			if (output != null) {
				result.add(output);
			}
		}
		return result;
	}

	@NotNull
	@Override
	public Collection<File> getOutputRoots(CompileContext context) {
		final Set<File> result = new THashSet<File>(FileUtil.FILE_HASHING_STRATEGY);
		final File moduleOutput = getModuleOutputDir();
		for (TaraConfiguration resConfig : getRootConfigurations(context.getProjectDescriptor().dataManager.getDataPaths())) {
			final File output = getOutputDir(moduleOutput, resConfig);
			if (output != null) {
				result.add(output);
			}
		}
		return result;
	}

Replace Generic With Diamond THashSet<File> with THashSet<> in method public getOutputRoots(context CompileContext) : Collection<File> from class org.jetbrains.jps.tara.model.impl.TaraTarget


	@NotNull
	@Override
	public ResolveResult[] multiResolve(boolean incompleteCode) {
		Project project = myElement.getProject();
		final List<TaraConceptDefinition> concepts = TaraUtil.findConcept(project, key);
		List<ResolveResult> results = new ArrayList<>();
		for (TaraConceptDefinition concept : concepts)
			results.add(new PsiElementResolveResult(concept));
		return results.toArray(new ResolveResult[results.size()]);
	}

	@NotNull
	@Override
	public ResolveResult[] multiResolve(boolean incompleteCode) {
		Project project = myElement.getProject();
		final List<TaraConceptDefinition> concepts = TaraUtil.findConcept(project, key);
		List<ResolveResult> results = new ArrayList<ResolveResult>();
		for (TaraConceptDefinition concept : concepts)
			results.add(new PsiElementResolveResult(concept));
		return results.toArray(new ResolveResult[results.size()]);
	}

Replace Generic With Diamond ArrayList<ResolveResult> with ArrayList<> in method public multiResolve(incompleteCode boolean) : ResolveResult[] from class monet.tara.metamodel.TaraReference


    private void initChoiceBoxes(){
        choiceBoxAirport.getItems().addAll(MockData.airportList());
        choiceBoxAirport.getSelectionModel().selectFirst();
        choiceBoxRunway.getItems().addAll(MockData.runwayList());
        choiceBoxRunway.getSelectionModel().selectFirst();
        topDownViewController.displayDirectedRunwaySelected(choiceBoxRunway.getSelectionModel().getSelectedItem());

        choiceBoxRunway.getSelectionModel().selectedItemProperty().addListener((observableValue, directedRunway, t1) -> {
            topDownViewController.displayDirectedRunwaySelected(observableValue.getValue());
            topDownViewController.updateUI();
        });

    }

    private void initChoiceBoxes(){
        choiceBoxAirport.getItems().addAll(MockData.airportList());
        choiceBoxAirport.getSelectionModel().selectFirst();
        choiceBoxRunway.getItems().addAll(MockData.runwayList());
        choiceBoxRunway.getSelectionModel().selectFirst();
        topDownViewController.displayDirectedRunwaySelected(choiceBoxRunway.getSelectionModel().getSelectedItem());

        choiceBoxRunway.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<Runway>() {
            @Override
            public void changed(ObservableValue<? extends Runway> observableValue, Runway directedRunway, Runway t1) {
                topDownViewController.displayDirectedRunwaySelected(observableValue.getValue());
                topDownViewController.updateUI();
            }
        });

    }

Replace Anonymous With Lambda seg.team9.controllers.PrimaryWindowController.initChoiceBoxes.addListener.new ChangeListener<Runway> with (observableValue, directedRunway, t1) -> {topDownViewController.displayDirectedRunwaySelected(observableValue.getValue()); in method private initChoiceBoxes() : void from class seg.team9.controllers.PrimaryWindowController


	public static void main(String[] args) {

		Manager dataSource = new ConnectionManager();
		StudentsCoursesDAO studentsCoursesDAO = new StudentsCoursesDAOImpl(dataSource);
		StudentsCoursesService studentsCoursesService = new StudentsCoursesServiceImpl(studentsCoursesDAO);

		StudentDAO studentDAO = new StudentsDAOImpl(dataSource);
		StudentsService studentsService = new StudentsServiceImpl(studentDAO);

		Dialogue initDialogue = new InitDialogue();
		DBInitializer dbInitializer = new DBInitializer();
		try (Scanner scanner = new Scanner(System.in)){
			dbInitializer.init();

			initDialogue.start(scanner);
		} catch (Exception ex) {
			System.err.println(ex.getMessage());
		}
	}

	public static void main(String[] args) {

		Manager dataSource = new ConnectionManager();
		StudentsCoursesDAO studentsCoursesDAO = new StudentsCoursesDAOImpl(dataSource);
		StudentsCoursesService studentsCoursesService = new StudentsCoursesServiceImpl(studentsCoursesDAO);

		StudentDAO studentDAO = new StudentsDAOImpl(dataSource);
		StudentsService studentsService = new StudentsServiceImpl(studentDAO);

		DBInitializer dbInitializer = new DBInitializer();
		try {
			dbInitializer.init();

			studentsCoursesService.findAll().forEach(System.out::println);

			studentsService.save(List.of(new Student("Dennis", "Yduin")));
		} catch (Exception ex) {
//			System.err.println(ex.getMessage());
		}
	}

Try With Resources try(Scanner scanner=new Scanner(System.in)) in method public main(args String[]) : void from class dev.yudin.SchoolApp


    /**
     * creates a new thread to send a messagge in order to not block the rest of the server while sent
     * @param message
     */
    @Override
    public void sendMessage(final Message message){
        new Thread(() -> send(message)).start();
    }

    /**
     * creates a new thread to send a messagge in order to not block the rest of the server while sent
     * @param message
     */
    @Override
    public void sendMessage(final Message message){
        new Thread(new Runnable() {
            @Override
            public void run() {
                send(message);
            }
        }).start();
    }

Replace Anonymous With Lambda it.polimi.ingsw.client.ServerConnection.sendMessage.start.new Thread.new Runnable with () -> send(message) in method public sendMessage(message Message) : void from class it.polimi.ingsw.client.ServerConnection


    private void bfs(boolean[][] visited, int row, int col, int[][] offsets) {
        int rows = this.matrixAdy.length;
        int cols = this.matrixAdy[0].length;
        Queue<Integer> queue = new Queue<>();
        int vertex = row * cols + col; // Convert 2D coordinates to 1D representation
        queue.addToTheQueue(vertex);
        visited[row][col] = true;

        while (!queue.isEmpty()) {

            int curr = (int)queue.unqueue();

            int currRow = curr / cols;
            int currCol = curr % cols;

            for (int[] offset : offsets) {
                int newRow = currRow + offset[0];
                int newCol = currCol + offset[1];

                if (newRow >= 0 && newRow < rows && newCol >= 0 && newCol < cols && this.matrixAdy[newRow][newCol] >0 && !visited[newRow][newCol]) {
                    int newVertex = newRow * cols + newCol; // Convert 2D coordinates to 1D representation
                    queue.addToTheQueue(newVertex);
                    visited[newRow][newCol] = true;
                }
            }
        }
    }

    private void bfs(boolean[][] visited, int row, int col, int[][] offsets) {
        int rows = this.matrixAdy.length;
        int cols = this.matrixAdy[0].length;
        Queue<Integer> queue = new Queue<Integer>();
        int vertex = row * cols + col; // Convert 2D coordinates to 1D representation
        queue.addToTheQueue(vertex);
        visited[row][col] = true;

        while (!queue.isEmpty()) {

            int curr = (int)queue.unqueue();

            int currRow = curr / cols;
            int currCol = curr % cols;

            for (int[] offset : offsets) {
                int newRow = currRow + offset[0];
                int newCol = currCol + offset[1];

                if (newRow >= 0 && newRow < rows && newCol >= 0 && newCol < cols && this.matrixAdy[newRow][newCol] >0 && !visited[newRow][newCol]) {
                    int newVertex = newRow * cols + newCol; // Convert 2D coordinates to 1D representation
                    queue.addToTheQueue(newVertex);
                    visited[newRow][newCol] = true;
                }
            }
        }
    }

Replace Generic With Diamond Queue<Integer> with Queue<> in method private bfs(visited boolean[][], row int, col int, offsets int[][]) : void from class classes.GraphMA


    @Override
    protected Cache<String, String> createCacheAdapter(String cacheName, Map<String, String> valuesMap) {
        return new EhCache3CacheAdapter<>(new org.ehcache.Cache<>() {

            private final Map<String, String> map = new HashMap<>(valuesMap);

            @Override
            public String get(String s) {
                return map.get(s);
            }

            @Override
            public Map<String, String> getAll(Set<? extends String> set) {
                throw new UnsupportedOperationException();
            }

            @Override
            public boolean containsKey(String s) {
                throw new UnsupportedOperationException();
            }

            @Override
            public void put(String s, String s2) {
                this.map.put(s, s2);
            }

            @Override
            public void putAll(Map<? extends String, ? extends String> map) {
                throw new UnsupportedOperationException();
            }

            @Override
            public String putIfAbsent(String s, String s2) {
                return this.map.putIfAbsent(s, s2);
            }

            @Override
            public void remove(String s) {
                map.remove(s);
            }

            @Override
            public boolean remove(String s, String s2) {
                return map.remove(s, s2);
            }

            @Override
            public String replace(String s, String s2) throws CacheLoadingException, CacheWritingException {
                return this.map.replace(s, s2);
            }

            @Override
            public boolean replace(String s, String s2, String v1) {
                return map.replace(s, s2, v1);
            }

            @Override
            public CacheRuntimeConfiguration<String, String> getRuntimeConfiguration() {
                return null;
            }

            @Override
            public void removeAll(Set<? extends String> set) {
                throw new UnsupportedOperationException();
            }

            @Override
            public void clear() {
                this.map.clear();
            }

            @Override
            public Iterator<Entry<String, String>> iterator() {
                throw new UnsupportedOperationException();
            }
        }, cacheName);
    }

    @Override
    protected Cache<String, String> createCacheAdapter(String cacheName, Map<String, String> valuesMap) {
        return new EhCache3CacheAdapter<>(new org.ehcache.Cache<String, String>() {

            private final Map<String, String> map = new HashMap<>(valuesMap);

            @Override
            public String get(String s) {
                return map.get(s);
            }

            @Override
            public Map<String, String> getAll(Set<? extends String> set) {
                throw new UnsupportedOperationException();
            }

            @Override
            public boolean containsKey(String s) {
                throw new UnsupportedOperationException();
            }

            @Override
            public void put(String s, String s2) {
                this.map.put(s, s2);
            }

            @Override
            public void putAll(Map<? extends String, ? extends String> map) {
                throw new UnsupportedOperationException();
            }

            @Override
            public String putIfAbsent(String s, String s2) {
                return this.map.putIfAbsent(s, s2);
            }

            @Override
            public void remove(String s) {
                map.remove(s);
            }

            @Override
            public boolean remove(String s, String s2) {
                return map.remove(s, s2);
            }

            @Override
            public String replace(String s, String s2) throws CacheLoadingException, CacheWritingException {
                return this.map.replace(s, s2);
            }

            @Override
            public boolean replace(String s, String s2, String v1) {
                return map.replace(s, s2, v1);
            }

            @Override
            public CacheRuntimeConfiguration<String, String> getRuntimeConfiguration() {
                return null;
            }

            @Override
            public void removeAll(Set<? extends String> set) {
                throw new UnsupportedOperationException();
            }

            @Override
            public void clear() {
                this.map.clear();
            }

            @Override
            public Iterator<Entry<String, String>> iterator() {
                throw new UnsupportedOperationException();
            }
        }, cacheName);
    }

Replace Generic With Diamond EhCache3CacheAdapter<> with EhCache3CacheAdapter<> in method protected createCacheAdapter(cacheName String, valuesMap Map<String,String>) : Cache<String,String> from class net.cache.bus.ehcache3.adapters.EhCache3CacheAdapterTest


    @Override
    public void run() {
        try {
            c.sendListenAddress();
            do {
                c.receive();
            } while (!this.isInterrupted());
        } catch (OtpErlangExit | OtpErlangDecodeException otpErlangExit) {
            otpErlangExit.printStackTrace();
        }
    }

    @Override
    public void run() {
        try {
            c.sendListenAddress();
            while(true) {
                c.receive();
            }
        } catch (OtpErlangExit otpErlangExit) {
            otpErlangExit.printStackTrace();
        } catch (OtpErlangDecodeException e) {
            e.printStackTrace();
        }
    }

Merge Catch [catch(OtpErlangExit otpErlangExit), catch(OtpErlangDecodeException e)] to catch(OtpErlangExit|OtpErlangDecodeException otpErlangExit) in method public run() : void from class it.unipi.lam.client0.ClientReceiver


    public static <T> Subscriber<T> subscribingList(CompletableFuture<List<T>> f, List<T> l) {
        return new SimpleSubscriber<>(f, l) {
            @Override
            public void onNext(T t) {
                l.add(t);
            }
        };
    }

    public static <T> Subscriber<T> subscribingList(CompletableFuture<List<T>> f, List<T> l) {
        return new Subscriber<T>() {
            @Override
            public void onSubscribe(Subscription subscription) {
                subscription.request(Long.MAX_VALUE);
            }

            @Override
            public void onNext(T t) {
                l.add(t);
            }

            @Override
            public void onError(Throwable throwable) {
                f.completeExceptionally(throwable);
            }

            @Override
            public void onComplete() {
                f.complete(l);
            }
        };
    }

Replace Generic With Diamond Subscriber<T> with SimpleSubscriber<> in method public subscribingList(f CompletableFuture<List<T>>, l List<T>) : Subscriber<T> from class com.github.dfauth.stream.dag.Utils