    @GetMapping("/jwt/{openid}")
    @Operation(summary = "测试阶段获取微信用户的 token")
    public SystemJsonResponse<String> getJWTByOpenid(@PathVariable("openid") @Parameter(description = "openid") String openid) {
        if(Boolean.FALSE.equals(swaggerCanBeVisited)) {
            // 无法访问 swagger，代表这个接口无法访问
            throw new GlobalServiceException(GlobalServiceStatusCode.SYSTEM_API_VISIT_FAIL);
        }
        Map<String, Object> tokenData = new HashMap<>(){{
            this.put(ExtractUtil.OPENID, openid);
        }};
        String jsonData = JsonUtil.analyzeData(tokenData);
        String token = JwtUtil.createJWT(jsonData);
        return SystemJsonResponse.SYSTEM_SUCCESS(token);
    }

    @GetMapping("/jwt/{openid}")
    @Operation(summary = "测试阶段获取微信用户的 token")
    public SystemJsonResponse<String> getJWTByOpenid(@PathVariable("openid") @Parameter(description = "openid") String openid) {
        if(Boolean.FALSE.equals(swaggerCanBeVisited)) {
            // 无法访问 swagger，代表这个接口无法访问
            throw new GlobalServiceException(GlobalServiceStatusCode.SYSTEM_API_VISIT_FAIL);
        }
        Map<String, Object> tokenData = new HashMap<String, Object>(){{
            this.put(ExtractUtil.OPENID, openid);
        }};
        String jsonData = JsonUtil.analyzeData(tokenData);
        String token = JwtUtil.createJWT(jsonData);
        return SystemJsonResponse.SYSTEM_SUCCESS(token);
    }

Replace Generic With Diamond HashMap<String,Object> with HashMap<> in method public getJWTByOpenid(openid String) : SystemJsonResponse<String> from class cn.lbcmmszdntnt.domain.okr.controller.CenterController


    @Override
    public String getUserFlag(String code) {
        String code2SessionUrl = "https://api.weixin.qq.com/sns/jscode2session";
        Map<String, Object> param = new HashMap<>() {{
            this.put("appid", TokenUtil.APP_ID);
            this.put("secret", TokenUtil.APP_SECRET);
            this.put("js_code", code);
            this.put("grant_type", "authorization_code");
        }};
        return HttpUtil.doGet(code2SessionUrl, param);
    }

    @Override
    public String getUserFlag(String code) {
        String code2SessionUrl = "https://api.weixin.qq.com/sns/jscode2session";
        Map<String, Object> param = new HashMap<String, Object>() {{
            this.put("appid", TokenUtil.APP_ID);
            this.put("secret", TokenUtil.APP_SECRET);
            this.put("js_code", code);
            this.put("grant_type", "authorization_code");
        }};
        return HttpUtil.doGet(code2SessionUrl, param);
    }

Replace Generic With Diamond HashMap<String,Object> with HashMap<> in method public getUserFlag(code String) : String from class cn.lbcmmszdntnt.domain.user.service.impl.UserServiceImpl


    public static void submit(Runnable... tasks) {
        // 提交任务
        Arrays.stream(tasks).forEach(CPUThreadPool::submit);
    }

    public static void submit(Runnable... tasks) {
        // 提交任务
        for (int i = 0; i < tasks.length; i++) {
            THREAD_POOL.submit(tasks[i]);
        }
    }

Replace Loop With Pipeline for(int i=0; i < tasks.length; i++) with Arrays.stream(tasks).forEach(CPUThreadPool::submit); in method public submit(tasks Runnable...) : void from class cn.lbcmmszdntnt.util.thread.pool.CPUThreadPool


    public static void submit(Runnable... tasks) {
        // 提交任务
        Arrays.stream(tasks).forEach(IOThreadPool::submit);
    }

Replace Loop With Pipeline for(int i=0; i < tasks.length; i++) with Arrays.stream(tasks).forEach(IOThreadPool::submit); in method public submit(tasks Runnable...) : void from class cn.lbcmmszdntnt.util.thread.pool.IOThreadPool


    static ParallelTransition getTransitionForMovingCardFromHandToField
            (GameView gameView, CardView cardView, CardView newCardView, int mode, int zone, int index) {

        Timeline addNewCardAnimation = new Timeline
                (new KeyFrame(new Duration(500), actionEvent -> {
                    gameView.gamePane.getChildren().remove(cardView);
                    newCardView.setVisible(true);
                }));
        ParallelTransition transitions;

        if (mode == 0 || mode == 2) {
            transitions = new ParallelTransition(
                    new ScaleAnimation(cardView, -(0.45555), 500).getAnimation(),
                    new TimelineTranslate(cardView, newCardView.getX() - 18,
                            newCardView.getY() - 28, 500).getAnimation(),
                    addNewCardAnimation);
        } else if (mode == 1) {

            Timeline hideCardAnimation = new Timeline(new KeyFrame(new Duration(250),
                    new EventHandler<ActionEvent>() {
                        @Override
                        public void handle(ActionEvent actionEvent) {
                            cardView.hideCard();
                        }
                    }));

            transitions = new ParallelTransition(
                    new ScaleAnimation(cardView, -(0.45555), 500).getAnimation(),
                    new TimelineTranslate(cardView, newCardView.getX() - 8,
                            newCardView.getY() - 38, 500).getAnimation(),
                    new RotateAnimation(cardView, 500, 90).getAnimation(),
                    addNewCardAnimation, hideCardAnimation);
        } else if (mode == 3) {
            transitions = new ParallelTransition(
                    new ScaleAnimation(cardView, -(0.45555), 500).getAnimation(),
                    new TimelineTranslate(cardView, newCardView.getX() - 18,
                            newCardView.getY() - 28, 500).getAnimation(),
                    new FlipAnimation(cardView, 500).getAnimation(),
                    addNewCardAnimation);
        } else {
            transitions = new ParallelTransition();
        }

        transitions.getChildren().add(getHandAnimationForCardsWasInHand(gameView));

        transitions.play();
        return transitions;
    }

    static ParallelTransition getTransitionForMovingCardFromHandToField
            (GameView gameView, CardView cardView, CardView newCardView, int mode, int zone, int index) {

        Timeline addNewCardAnimation = new Timeline
                (new KeyFrame(new Duration(500), new EventHandler<ActionEvent>() {
                    @Override
                    public void handle(ActionEvent actionEvent) {
                        gameView.gamePane.getChildren().remove(cardView);
                        newCardView.setVisible(true);
                    }
                }));
        ParallelTransition transitions;

        if (mode == 0 || mode == 2) {
            transitions = new ParallelTransition(
                    new ScaleAnimation(cardView, -(0.45555), 500).getAnimation(),
                    new TimelineTranslate(cardView, newCardView.getX() - 18,
                            newCardView.getY() - 28, 500).getAnimation(),
                    addNewCardAnimation);
        } else if (mode == 1) {

            Timeline hideCardAnimation = new Timeline(new KeyFrame(new Duration(250),
                    new EventHandler<ActionEvent>() {
                        @Override
                        public void handle(ActionEvent actionEvent) {
                            cardView.hideCard();
                        }
                    }));

            transitions = new ParallelTransition(
                    new ScaleAnimation(cardView, -(0.45555), 500).getAnimation(),
                    new TimelineTranslate(cardView, newCardView.getX() - 8,
                            newCardView.getY() - 38, 500).getAnimation(),
                    new RotateAnimation(cardView, 500, 90).getAnimation(),
                    addNewCardAnimation, hideCardAnimation);
        } else if (mode == 3) {
            transitions = new ParallelTransition(
                    new ScaleAnimation(cardView, -(0.45555), 500).getAnimation(),
                    new TimelineTranslate(cardView, newCardView.getX() - 18,
                            newCardView.getY() - 28, 500).getAnimation(),
                    new FlipAnimation(cardView, 500).getAnimation(),
                    addNewCardAnimation);
        } else {
            transitions = new ParallelTransition();
        }

        transitions.getChildren().add(getHandAnimationForCardsWasInHand(gameView));

        transitions.play();
        return transitions;
    }

Replace Anonymous With Lambda view.graphic.ActionsAnimationHandler.getTransitionForMovingCardFromHandToField.addNewCardAnimation.new Timeline.new KeyFrame.new EventHandler<ActionEvent> with actionEvent -> {gameView.gamePane.getChildren().remove(cardView); in method package getTransitionForMovingCardFromHandToField(gameView GameView, cardView CardView, newCardView CardView, mode int, zone int, index int) : ParallelTransition from class view.graphic.ActionsAnimationHandler


    private void addPhaseChangeButton() {

        Button phaseButton = new Button("N\nP");
        phaseButton.setLayoutX(0);
        phaseButton.setLayoutY(5);
        phaseButton.setOnMouseEntered(mouseEvent -> {
            if (game.gameData.getCurrentGamer().equals(self)) {
                nextPhasePopup = menuGraphic.showPopupMessage(stage, "next phase",
                        stage.getX() + 235,
                        stage.getY() + 20);
            }
        });

        phaseButton.setOnMouseExited(mouseEvent -> {
            if (nextPhasePopup != null && nextPhasePopup.isShowing()) {
                nextPhasePopup.hide();
            }
        });
        phaseButton.setOnMouseClicked(event -> {
            if (game.gameData.getCurrentGamer().equals(self)) {
                ArrayList<DataFromGameRun> events = new ArrayList<>(game.run(new DataForGameRun("next phase", self)));
                gameController.graphicsForEvents(events, null, 0);
            }
        });

        gamePane.getChildren().add(phaseButton);
    }

    private void addPhaseChangeButton() {

        Button phaseButton = new Button("N\nP");
        phaseButton.setLayoutX(0);
        phaseButton.setLayoutY(5);
        phaseButton.setOnMouseEntered(new EventHandler<MouseEvent>() {
            @Override
            public void handle(MouseEvent mouseEvent) {
                if (game.gameData.getCurrentGamer().equals(self)) {
                    nextPhasePopup = menuGraphic.showPopupMessage(stage, "next phase",
                            stage.getX() + 235,
                            stage.getY() + 20);
                }
            }
        });

        phaseButton.setOnMouseExited(new EventHandler<MouseEvent>() {
            @Override
            public void handle(MouseEvent mouseEvent) {
                if (nextPhasePopup != null && nextPhasePopup.isShowing()) {
                    nextPhasePopup.hide();
                }
            }
        });
        phaseButton.setOnMouseClicked(event -> {
            if (game.gameData.getCurrentGamer().equals(self)) {
                ArrayList<DataFromGameRun> events = new ArrayList<>(game.run(new DataForGameRun("next phase", self)));
                gameController.graphicsForEvents(events, null, 0);
            }
        });

        gamePane.getChildren().add(phaseButton);
    }

Replace Anonymous With Lambda view.graphic.GameView.addPhaseChangeButton.setOnMouseEntered.new EventHandler<MouseEvent> with mouseEvent -> {if(game.gameData.getCurrentGamer().equals(self)){nextPhasePopup=menuGraphic.showPopupMessage(stage,"next phase",stage.getX() + 235,stage.getY() + 20); in method private addPhaseChangeButton() : void from class view.graphic.GameView


    double handleRivalAttackResultGraphic(Matcher matcher) {

        matcher.find();
        int attackerID = getIndexByRivalId(Integer.parseInt(matcher.group(1)));
        boolean destroyAttacker = matcher.group(2).equals("destroy");
        int attackedID = getIndexById(Integer.parseInt(matcher.group(3)));
        boolean destroyAttacked = matcher.group(4).equals("destroy");
        boolean flipAttacked = matcher.group(5).equals("flip ");
        boolean isLpLoserSelf = matcher.group(6).equals("rival");
        int lp = -Integer.parseInt(matcher.group(7));

        System.out.println(attackerID + " " + destroyAttacker + " " +
                attackedID + " " + destroyAttacked + " " + flipAttacked + " " + isLpLoserSelf + " " +
                lp);

        double time = 10;

        if (flipAttacked) {
            time = handleFlipCardGraphic(monsterZoneCards.get(attackedID));
        }

        new Timeline(new KeyFrame(Duration.millis(time), actionEvent -> {

            double time1 = handleIncreaseLpGraphic(lp, isLpLoserSelf) + 10;

            new Timeline(new KeyFrame(Duration.millis(time1), actionEvent1 -> {
                if (destroyAttacker) {
                    handleDestroyCardFromField(attackerID, 0, false);
                }

                if (destroyAttacked) {
                    handleDestroyCardFromField(attackedID, 0, true);
                }
            })).play();
        })).play();

        return time + lp + 500;
    }

    double handleRivalAttackResultGraphic(Matcher matcher) {

        matcher.find();
        int attackerID = getIndexByRivalId(Integer.parseInt(matcher.group(1)));
        boolean destroyAttacker = matcher.group(2).equals("destroy");
        int attackedID = getIndexById(Integer.parseInt(matcher.group(3)));
        boolean destroyAttacked = matcher.group(4).equals("destroy");
        boolean flipAttacked = matcher.group(5).equals("flip ");
        boolean isLpLoserSelf = matcher.group(6).equals("rival");
        int lp = -Integer.parseInt(matcher.group(7));

        System.out.println(attackerID + " " + destroyAttacker + " " +
                attackedID + " " + destroyAttacked + " " + flipAttacked + " " + isLpLoserSelf + " " +
                lp);

        double time = 10;

        if (flipAttacked) {
            time = handleFlipCardGraphic(monsterZoneCards.get(attackedID));
        }

        new Timeline(new KeyFrame(Duration.millis(time), new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent actionEvent) {

                double time = handleIncreaseLpGraphic(lp, isLpLoserSelf) + 10;

                new Timeline(new KeyFrame(Duration.millis(time), new EventHandler<ActionEvent>() {
                    @Override
                    public void handle(ActionEvent actionEvent) {
                        if (destroyAttacker) {
                            handleDestroyCardFromField(attackerID, 0, false);
                        }

                        if (destroyAttacked) {
                            handleDestroyCardFromField(attackedID, 0, true);
                        }
                    }
                })).play();
            }
        })).play();

        return time + lp + 500;
    }

Replace Anonymous With Lambda view.graphic.GameView.handleRivalAttackResultGraphic.play.new Timeline.new KeyFrame.new EventHandler<ActionEvent> with actionEvent -> {double time1=handleIncreaseLpGraphic(lp,isLpLoserSelf) + 10; in method package handleRivalAttackResultGraphic(matcher Matcher) : double from class view.graphic.GameView


    double handleAttackResultGraphic(Matcher matcher) {

        matcher.find();

        int attackerID = getIndexById(Integer.parseInt(matcher.group(1)));
        boolean destroyAttacker = matcher.group(2).equals("destroy");
        int attackedID = getIndexByRivalId(Integer.parseInt(matcher.group(3)));
        boolean destroyAttacked = matcher.group(4).equals("destroy");
        boolean flipAttacked = matcher.group(5).equals("flip ");
        boolean isLpLoserSelf = matcher.group(6).equals("self");
        int lp = -Integer.parseInt(matcher.group(7));

        double time = 10;

        if (flipAttacked) {
            time = handleFlipCardGraphic(rivalMonsterZoneCards.get(attackedID));
        }

        new Timeline(new KeyFrame(Duration.millis(time), actionEvent -> {

            double time1 = handleIncreaseLpGraphic(lp, isLpLoserSelf) + 10;

            new Timeline(new KeyFrame(Duration.millis(time1), actionEvent1 -> {
                if (destroyAttacker) {
                    handleDestroyCardFromField(attackerID, 0, true);
                }

                if (destroyAttacked) {

                    handleDestroyCardFromField(attackedID, 0, false);
                }
            })).play();
        })).play();

        return time + lp + 500;
    }

    double handleAttackResultGraphic(Matcher matcher) {

        matcher.find();

        int attackerID = getIndexById(Integer.parseInt(matcher.group(1)));
        boolean destroyAttacker = matcher.group(2).equals("destroy");
        int attackedID = getIndexByRivalId(Integer.parseInt(matcher.group(3)));
        boolean destroyAttacked = matcher.group(4).equals("destroy");
        boolean flipAttacked = matcher.group(5).equals("flip ");
        boolean isLpLoserSelf = matcher.group(6).equals("self");
        int lp = -Integer.parseInt(matcher.group(7));

        double time = 10;

        if (flipAttacked) {
            time = handleFlipCardGraphic(rivalMonsterZoneCards.get(attackedID));
        }

        new Timeline(new KeyFrame(Duration.millis(time), new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent actionEvent) {

                double time = handleIncreaseLpGraphic(lp, isLpLoserSelf) + 10;

                new Timeline(new KeyFrame(Duration.millis(time), new EventHandler<ActionEvent>() {
                    @Override
                    public void handle(ActionEvent actionEvent) {
                        if (destroyAttacker) {
                            handleDestroyCardFromField(attackerID, 0, true);
                        }

                        if (destroyAttacked) {

                            handleDestroyCardFromField(attackedID, 0, false);
                        }
                    }
                })).play();
            }
        })).play();

        return time + lp + 500;
    }

Replace Anonymous With Lambda view.graphic.GameView.handleAttackResultGraphic.play.new Timeline.new KeyFrame.new EventHandler<ActionEvent> with actionEvent -> {double time1=handleIncreaseLpGraphic(lp,isLpLoserSelf) + 10; in method package handleAttackResultGraphic(matcher Matcher) : double from class view.graphic.GameView


    private Label createMonitoredLabel(final Label reporter) {
        final Label monitored = new Label("Mouse Location Monitor");

        monitored.setStyle("-fx-background-color: forestgreen; -fx-text-fill: white; -fx-font-size: 20px;");

        stage.getScene().setOnMouseMoved(event -> {
            String msg =
                    "(x: " + event.getX() + ", y: " + event.getY() + ") -- " +
                            "(sceneX: " + event.getSceneX() + ", sceneY: " + event.getSceneY() + ") -- " +
                            "(screenX: " + event.getScreenX() + ", screenY: " + event.getScreenY() + ")";

            reporter.setText(msg);
        });

        return monitored;
    }

    private Label createMonitoredLabel(final Label reporter) {
        final Label monitored = new Label("Mouse Location Monitor");

        monitored.setStyle("-fx-background-color: forestgreen; -fx-text-fill: white; -fx-font-size: 20px;");

        stage.getScene().setOnMouseMoved(new EventHandler<MouseEvent>() {
            @Override
            public void handle(MouseEvent event) {
                String msg =
                        "(x: " + event.getX() + ", y: " + event.getY() + ") -- " +
                                "(sceneX: " + event.getSceneX() + ", sceneY: " + event.getSceneY() + ") -- " +
                                "(screenX: " + event.getScreenX() + ", screenY: " + event.getScreenY() + ")";

                reporter.setText(msg);
            }
        });

        return monitored;
    }

Replace Anonymous With Lambda view.graphic.GameView.createMonitoredLabel.setOnMouseMoved.new EventHandler<MouseEvent> with event -> {String msg="(x: " + event.getX() + ", y: " + event.getY() + ") -- " + "(sceneX: " + event.getSceneX() + ", sceneY: " + event.getSceneY() + ") -- " + "(screenX: " + event.getScreenX() + ", screenY: " + event.getScreenY() + ")"; in method private createMonitoredLabel(reporter Label) : Label from class view.graphic.GameView


    public void run(){
        Pane pane = new Pane();

        ImageView imageView = new ImageView(new Image("/Pictures/atk_icon.png"));
        pane.getChildren().add(imageView);
        imageView.setX(250);
        imageView.setY(100);
        imageView.maxHeight(50);

        pane.setOnMouseMoved(mouseEvent -> {

            double temp1 = (mouseEvent.getX() - imageView.getBoundsInParent().getCenterX());
            double temp2 = (mouseEvent.getY() - imageView.getBoundsInParent().getCenterY());
            double ans = (-temp1/temp2);
            double temp = temp2 > 0 ? 180 : 0;
            imageView.setRotate(temp + Math.toDegrees(Math.atan(ans)));
        });

        pane.setOnMouseClicked(mouseEvent -> {
            Timeline animation = new Timeline();
            KeyFrame kf = new KeyFrame(Duration.millis(400),
                    new KeyValue(imageView.xProperty(), mouseEvent.getX() - imageView.getFitWidth() / 2),
                    new KeyValue(imageView.yProperty(), mouseEvent.getY()));

            animation.getKeyFrames().add(kf);
            animation.play();
        });

        stage.getScene().setRoot(pane);
    }

    public void run(){
        Pane pane = new Pane();

        ImageView imageView = new ImageView(new Image("/Pictures/atk_icon.png"));
        pane.getChildren().add(imageView);
        imageView.setX(250);
        imageView.setY(100);
        imageView.maxHeight(50);

        pane.setOnMouseMoved(new EventHandler<MouseEvent>() {
            @Override
            public void handle(MouseEvent mouseEvent) {

                double temp1 = (mouseEvent.getX() - imageView.getBoundsInParent().getCenterX());
                double temp2 = (mouseEvent.getY() - imageView.getBoundsInParent().getCenterY());
                double ans = (-temp1/temp2);
                double temp = temp2 > 0 ? 180 : 0;
                imageView.setRotate(temp + Math.toDegrees(Math.atan(ans)));
            }
        });

        pane.setOnMouseClicked(new EventHandler<MouseEvent>() {
            @Override
            public void handle(MouseEvent mouseEvent) {
                Timeline animation = new Timeline();
                KeyFrame kf = new KeyFrame(Duration.millis(400),
                        new KeyValue(imageView.xProperty(), mouseEvent.getX() - imageView.getFitWidth() / 2),
                        new KeyValue(imageView.yProperty(), mouseEvent.getY()));

                animation.getKeyFrames().add(kf);
                animation.play();
            }
        });

        stage.getScene().setRoot(pane);
    }

Replace Anonymous With Lambda view.graphic.justForIzad.run.setOnMouseMoved.new EventHandler<MouseEvent> with mouseEvent -> {double temp1=(mouseEvent.getX() - imageView.getBoundsInParent().getCenterX()); in method public run() : void from class view.graphic.justForIzad


    public static void showPopupMessage(final String message) {

        final Popup popup = createPopup(message);
        popup.show(stage);

        Timeline idlestage = new Timeline(new KeyFrame(Duration.seconds(3), event -> popup.hide()));
        idlestage.setCycleCount(1);
        idlestage.play();
    }

    public static void showPopupMessage(final String message) {

        final Popup popup = createPopup(message);
        popup.show(stage);

        Timeline idlestage = new Timeline(new KeyFrame(Duration.seconds(3), new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent event) {
                popup.hide();
            }
        }));
        idlestage.setCycleCount(1);
        idlestage.play();
    }

Replace Anonymous With Lambda view.graphic.menuGraphic.showPopupMessage.idlestage.new Timeline.new KeyFrame.new EventHandler<ActionEvent> with event -> popup.hide() in method public showPopupMessage(message String) : void from class view.graphic.menuGraphic


    private CardView getCardForGraveyard(Card card, boolean isSelf) {
        CardView cardView = new CardView(card, 9, false);

        cardView.setOnMouseClicked(mouseEvent -> showGraveYard(isSelf));

        return cardView;
    }

    private CardView getCardForGraveyard(Card card, boolean isSelf) {
        CardView cardView = new CardView(card, 9, false);

        cardView.setOnMouseClicked(new EventHandler<MouseEvent>() {
            @Override
            public void handle(MouseEvent mouseEvent) {
                showGraveYard(isSelf);
            }
        });

        return cardView;
    }

Replace Anonymous With Lambda view.graphic.GameView.getCardForGraveyard.setOnMouseClicked.new EventHandler<MouseEvent> with mouseEvent -> showGraveYard(isSelf) in method private getCardForGraveyard(card Card, isSelf boolean) : CardView from class view.graphic.GameView


    private void showGraveYard(boolean isSelf) {

        ScrollPane graveyardScrollPane = new ScrollPane();

        graveyardScrollPane.addEventFilter(MouseEvent.MOUSE_CLICKED, mouseEvent -> {
            if (mouseEvent.getButton() == MouseButton.SECONDARY) {
                mainPane.getChildren().remove(graveyardScrollPane);
            }
        });

        graveyardScrollPane.setId("graveyard");
        mainPane.getChildren().add(graveyardScrollPane);

        graveyardScrollPane.setLayoutX(250);
        graveyardScrollPane.setLayoutY(200);

        HBox box = new HBox(5);

        ArrayList<CardView> cards = isSelf ? selfGraveyardCards : rivalGraveyardCards;

        for (CardView cardView : cards) {
            CardView temp = new CardView(cardView.getCard(), 4, false);
            setShowCardOnMouseEntered(temp);
            box.getChildren().add(temp);
        }

        graveyardScrollPane.setContent(box);
        graveyardScrollPane.setMaxWidth(450);
        graveyardScrollPane.setMinWidth(450);
        graveyardScrollPane.setMinHeight(170);

    }

    private void showGraveYard(boolean isSelf) {

        ScrollPane graveyardScrollPane = new ScrollPane();

        graveyardScrollPane.addEventFilter(MouseEvent.MOUSE_CLICKED, new EventHandler<MouseEvent>() {
            @Override
            public void handle(MouseEvent mouseEvent) {
                if (mouseEvent.getButton() == MouseButton.SECONDARY) {
                    mainPane.getChildren().remove(graveyardScrollPane);
                }
            }
        });

        graveyardScrollPane.setId("graveyard");
        mainPane.getChildren().add(graveyardScrollPane);

        graveyardScrollPane.setLayoutX(250);
        graveyardScrollPane.setLayoutY(200);

        HBox box = new HBox(5);

        ArrayList<CardView> cards = isSelf ? selfGraveyardCards : rivalGraveyardCards;

        for (CardView cardView : cards) {
            CardView temp = new CardView(cardView.getCard(), 4, false);
            setShowCardOnMouseEntered(temp);
            box.getChildren().add(temp);
        }

        graveyardScrollPane.setContent(box);
        graveyardScrollPane.setMaxWidth(450);
        graveyardScrollPane.setMinWidth(450);
        graveyardScrollPane.setMinHeight(170);

    }

Replace Anonymous With Lambda view.graphic.GameView.showGraveYard.addEventFilter.new EventHandler<MouseEvent> with mouseEvent -> {if(mouseEvent.getButton() == MouseButton.SECONDARY){mainPane.getChildren().remove(graveyardScrollPane); in method private showGraveYard(isSelf boolean) : void from class view.graphic.GameView


    private Animation getHandAnimation(ArrayList<Card> cardViews, int index){

        CardView cardView = new CardView(cardViews.get(index), 8, true);

        Animation tr = getTransitionForAddCardFromDeckToHand(cardView);

        tr.setOnFinished(actionEvent -> {
            if(index < 4){
                getHandAnimation(cardViews, index + 1).play();
            }
        });

        return tr;
    }

    private Animation getHandAnimation(ArrayList<Card> cardViews, int index){

        CardView cardView = new CardView(cardViews.get(index), 8, true);

        Animation tr = getTransitionForAddCardFromDeckToHand(cardView);

        tr.setOnFinished(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent actionEvent) {
                if(index < 4){
                    getHandAnimation(cardViews, index + 1).play();
                }
            }
        });

        return tr;
    }

Replace Anonymous With Lambda view.graphic.GameView.getHandAnimation.setOnFinished.new EventHandler<ActionEvent> with actionEvent -> {if(index < 4){getHandAnimation(cardViews,index + 1).play(); in method private getHandAnimation(cardViews ArrayList<Card>, index int) : Animation from class view.graphic.GameView


    public ParallelTransition getTransitionForAddCardFromRivalDeckToRivalHand(CardView cardView) {

        cardView.setX(40);
        cardView.setY(92);
        gamePane.getChildren().add(cardView);
        CardView newCardView = getCardForRivalHand(cardView.getCard());
        rivalHand.add(newCardView);
        newCardView.setX(getCardInRivalHandX(newCardView));
        newCardView.setY(getCardinRivalHandY());
        newCardView.setVisible(false);
        gamePane.getChildren().add(newCardView);

        KeyFrame createNewCardAnimation = new KeyFrame(Duration.millis(700), actionEvent -> {
            newCardView.setVisible(true);
            gamePane.getChildren().remove(cardView);
        });

        Timeline timeline = new Timeline(createNewCardAnimation);

        ParallelTransition transitions = new ParallelTransition(
                new ScaleAnimation(cardView, 0.6, 700).getAnimation(),
                new TimelineTranslate(cardView, getCardInRivalHandX(newCardView) + 15,
                        getCardinRivalHandY() + 23, 700).getAnimation(), timeline

        );

        for(CardView cardView1 : rivalHand){
            if(cardView1 != newCardView){
                transitions.getChildren().add(new TimelineTranslate
                        (cardView1, getCardInRivalHandX(cardView1), getCardinRivalHandY(), 700)
                        .getAnimation());
            }
        }

        return transitions;
    }

    public ParallelTransition getTransitionForAddCardFromRivalDeckToRivalHand(CardView cardView) {

        cardView.setX(40);
        cardView.setY(92);
        gamePane.getChildren().add(cardView);
        CardView newCardView = getCardForRivalHand(cardView.getCard());
        rivalHand.add(newCardView);
        newCardView.setX(getCardInRivalHandX(newCardView));
        newCardView.setY(getCardinRivalHandY());
        newCardView.setVisible(false);
        gamePane.getChildren().add(newCardView);

        KeyFrame createNewCardAnimation = new KeyFrame(Duration.millis(700), new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent actionEvent) {
                newCardView.setVisible(true);
                gamePane.getChildren().remove(cardView);
            }
        });

        Timeline timeline = new Timeline(createNewCardAnimation);

        ParallelTransition transitions = new ParallelTransition(
                new ScaleAnimation(cardView, 0.6, 700).getAnimation(),
                new TimelineTranslate(cardView, getCardInRivalHandX(newCardView) + 15,
                        getCardinRivalHandY() + 23, 700).getAnimation(), timeline

        );

        for(CardView cardView1 : rivalHand){
            if(cardView1 != newCardView){
                transitions.getChildren().add(new TimelineTranslate
                        (cardView1, getCardInRivalHandX(cardView1), getCardinRivalHandY(), 700)
                        .getAnimation());
            }
        }

        return transitions;
    }

Replace Anonymous With Lambda view.graphic.GameView.getTransitionForAddCardFromRivalDeckToRivalHand.createNewCardAnimation.new KeyFrame.new EventHandler<ActionEvent> with actionEvent -> {newCardView.setVisible(true); in method public getTransitionForAddCardFromRivalDeckToRivalHand(cardView CardView) : ParallelTransition from class view.graphic.GameView


    private CardView getCardViewByCardForMonsterAndSpellZone(Card card, int i, int j) {
        CardView cardView = new CardView(card, 9, false);

        cardView.setOnMouseEntered(mouseEvent -> showCard(card));

        cardView.setX(122 + i * 82);
        cardView.setY(101 + 100 * j);
        return cardView;
    }

    private CardView getCardViewByCardForMonsterAndSpellZone(Card card, int i, int j) {
        CardView cardView = new CardView(card, 9, false);

        cardView.setOnMouseEntered(new EventHandler<MouseEvent>() {
            @Override
            public void handle(MouseEvent mouseEvent) {
                showCard(card);
            }
        });

        cardView.setX(122 + i * 82);
        cardView.setY(101 + 100 * j);
        return cardView;
    }

Replace Anonymous With Lambda view.graphic.GameView.getCardViewByCardForMonsterAndSpellZone.setOnMouseEntered.new EventHandler<MouseEvent> with mouseEvent -> showCard(card) in method private getCardViewByCardForMonsterAndSpellZone(card Card, i int, j int) : CardView from class view.graphic.GameView


    private void setShowCardOnMouseEntered(CardView cardView){
        cardView.setOnMouseEntered(mouseEvent -> showCard(cardView.card));
    }

    private void setShowCardOnMouseEntered(CardView cardView){
        cardView.setOnMouseEntered(new EventHandler<MouseEvent>() {
            @Override
            public void handle(MouseEvent mouseEvent) {
                showCard(cardView.card);
            }
        });
    }

Replace Anonymous With Lambda view.graphic.GameView.setShowCardOnMouseEntered.setOnMouseEntered.new EventHandler<MouseEvent> with mouseEvent -> showCard(cardView.card) in method private setShowCardOnMouseEntered(cardView CardView) : void from class view.graphic.GameView


    public static Object getInstanceOfAnObjectByClassName(String type) {

        Class myClass = null;
        try {
            myClass = Class.forName(type);

        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }

        try {
            return myClass.getDeclaredConstructor().newInstance();

        } catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException | InstantiationException e) {
            e.printStackTrace();
        }
        return null;
    }

    public static Object getInstanceOfAnObjectByClassName(String type){

        Class myClass = null;
        try {
            myClass = Class.forName(type);

        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }

        try {
            return myClass.getDeclaredConstructor().newInstance();

        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (NoSuchMethodException e) {
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        }
        return null;
    }

Merge Catch [catch(IllegalAccessException e), catch(InstantiationException e), catch(NoSuchMethodException e), catch(InvocationTargetException e)] to catch(IllegalAccessException|NoSuchMethodException|InvocationTargetException|InstantiationException e) in method public getInstanceOfAnObjectByClassName(type String) : Object from class controller.DataBaseControllers.DataBaseController


		public Node(String id) {
			super();
			this.id = id;
			this.links = new ArrayList<>();
		}

		public Node(String id) {
			super();
			this.id = id;
			this.links = new ArrayList<Node>();
		}

Replace Generic With Diamond ArrayList<Node> with ArrayList<> in method public Node(id String) from class org.onap.music.main.DeadlockDetectionUtil.Node


	public DeadlockDetectionUtil() {
		this.nodeList = new HashMap<>();
	}

	public DeadlockDetectionUtil() {
		this.nodeList = new HashMap<String, Node>();
	}

Replace Generic With Diamond HashMap<String,Node> with HashMap<> in method public DeadlockDetectionUtil() from class org.onap.music.main.DeadlockDetectionUtil


    public List<String> getAllLocksForOwner(String ownerId, String keyspace, String table) throws MusicServiceException, MusicQueryException {
        List<String> toRet = new ArrayList<>();
        String lockTable = table_prepend_name + table;
        PreparedQueryObject queryObject = new PreparedQueryObject();
        queryObject.appendQueryString("SELECT key, lockreference FROM " + keyspace + "." + lockTable);
        queryObject.appendQueryString(" WHERE owner = '" + ownerId + "' ALLOW FILTERING");

        ResultSet rs = dsHandle.executeQuorumConsistencyGet(queryObject);
        Iterator<Row> it = rs.iterator();
        while (it.hasNext()) {
            Row row = it.next();
            toRet.add(row.getString("key") + "$" + row.getLong("lockreference"));
        }
        return toRet;
    }

    public List<String> getAllLocksForOwner(String ownerId, String keyspace, String table) throws MusicServiceException, MusicQueryException {
        List<String> toRet = new ArrayList<String>();
        String lockTable = table_prepend_name + table;
        PreparedQueryObject queryObject = new PreparedQueryObject();
        queryObject.appendQueryString("SELECT key, lockreference FROM " + keyspace + "." + lockTable);
        queryObject.appendQueryString(" WHERE owner = '" + ownerId + "' ALLOW FILTERING");

        ResultSet rs = dsHandle.executeQuorumConsistencyGet(queryObject);
        Iterator<Row> it = rs.iterator();
        while (it.hasNext()) {
            Row row = it.next();
            toRet.add(row.getString("key") + "$" + row.getLong("lockreference"));
        }
        return toRet;
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public getAllLocksForOwner(ownerId String, keyspace String, table String) : List<String> from class org.onap.music.lockingservice.cassandra.CassaLockStore


    public static void readAndSetKeyString() {
        try (Scanner in = new Scanner(new FileReader("/opt/app/music/etc/properties.txt"))) {

            StringBuilder sb = new StringBuilder();
            while(in.hasNext()) {
                sb.append(in.next());
            }
            keyString = sb.toString();
        } catch (FileNotFoundException e) {
            logger.error(EELFLoggerDelegate.errorLogger, e.getMessage());
        }
    }

    public static void readAndSetKeyString() {
        try {
            Scanner in = new Scanner(new FileReader("/opt/app/music/etc/properties.txt"));
            StringBuilder sb = new StringBuilder();
            while(in.hasNext()) {
                sb.append(in.next());
            }
            in.close();
            keyString = sb.toString();
        } catch (FileNotFoundException e) {
            logger.error(EELFLoggerDelegate.errorLogger, e.getMessage());
        }
    }

Try With Resources try(Scanner in=new Scanner(new FileReader("/opt/app/music/etc/properties.txt"))) in method public readAndSetKeyString() : void from class org.onap.music.main.CipherUtil


    /**
     *
     * @return
     */
    private ArrayList<String> getAllPossibleLocalIps() {
        ArrayList<String> allPossibleIps = new ArrayList<>();
        try {
            Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces();
            while (en.hasMoreElements()) {
                NetworkInterface ni = (NetworkInterface) en.nextElement();
                Enumeration<InetAddress> ee = ni.getInetAddresses();
                while (ee.hasMoreElements()) {
                    InetAddress ia = (InetAddress) ee.nextElement();
                    allPossibleIps.add(ia.getHostAddress());
                }
            }
        } catch (SocketException e) {
            logger.error(EELFLoggerDelegate.errorLogger, e.getMessage(), AppMessages.CONNCECTIVITYERROR, ErrorSeverity.ERROR, ErrorTypes.CONNECTIONERROR);
        }catch(Exception e) {
        	logger.error(EELFLoggerDelegate.errorLogger, e.getMessage(), ErrorSeverity.ERROR, ErrorTypes.GENERALSERVICEERROR);
        }
        return allPossibleIps;
    }

    /**
     *
     * @return
     */
    private ArrayList<String> getAllPossibleLocalIps() {
        ArrayList<String> allPossibleIps = new ArrayList<String>();
        try {
            Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces();
            while (en.hasMoreElements()) {
                NetworkInterface ni = (NetworkInterface) en.nextElement();
                Enumeration<InetAddress> ee = ni.getInetAddresses();
                while (ee.hasMoreElements()) {
                    InetAddress ia = (InetAddress) ee.nextElement();
                    allPossibleIps.add(ia.getHostAddress());
                }
            }
        } catch (SocketException e) {
            logger.error(EELFLoggerDelegate.errorLogger, e.getMessage(), AppMessages.CONNCECTIVITYERROR, ErrorSeverity.ERROR, ErrorTypes.CONNECTIONERROR);
        }catch(Exception e) {
        	logger.error(EELFLoggerDelegate.errorLogger, e.getMessage(), ErrorSeverity.ERROR, ErrorTypes.GENERALSERVICEERROR);
        }
        return allPossibleIps;
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method private getAllPossibleLocalIps() : ArrayList<String> from class org.onap.music.datastore.MusicDataStore


        /**
         * the command that is run and retried for actually obtaining the lock
         *
         * @return if the command was successful or not
         */
        public boolean execute() throws KeeperException, InterruptedException {
            do {
                if (id == null) {
                    String prefix = "x-";
                    byte[] data = {0x12, 0x34};
                    id = zookeeper.create(dir + "/" + prefix, data, getAcl(),
                                    CreateMode.PERSISTENT_SEQUENTIAL);

                    if (logger.isDebugEnabled()) {
                    	logger.debug(EELFLoggerDelegate.debugLogger, "Created id: " + id);
                    }
                    if (id != null) {
                        Stat stat = null;
                        try {
                            stat = zookeeper.exists(id, false);
                        } catch (KeeperException | InterruptedException e1) {
                            logger.error(EELFLoggerDelegate.errorLogger, "Error in execute: " + e1);
                        }
                        Long ctime = stat.getCtime();
                        MusicUtil.zkNodeMap.put(id, ctime);
                        PreparedQueryObject pQuery = new PreparedQueryObject();
                        pQuery.appendQueryString(
                                        "INSERT INTO admin.locks(lock_id, ctime) VALUES (?,?)");
                        try {
                            pQuery.addValue(MusicUtil.convertToActualDataType(DataType.text(), id));
                            pQuery.addValue(MusicUtil.convertToActualDataType(DataType.text(), ctime));
                            MusicCore.eventualPut(pQuery);
                        } catch (Exception e) {
                        	logger.error(EELFLoggerDelegate.errorLogger, "Error in execute: " + e);
                        }
                        break;
                   }
                }
                if (id != null) {
                    List<String> names = zookeeper.getChildren(dir, false);
                    if (names.isEmpty()) {
                        logger.info(EELFLoggerDelegate.applicationLogger, "No children in: " + dir
                                        + " when we've just " + "created one! Lets recreate it...");
                        // lets force the recreation of the id
                        id = null;
                        return Boolean.FALSE;

                    } else {
                        // lets sort them explicitly (though they do seem to come back in order
                        // ususally :)
                        ZNodeName idName = new ZNodeName(id);
                        SortedSet<ZNodeName> sortedNames = new TreeSet<>();
                        for (String name : names) {
                            sortedNames.add(new ZNodeName(dir + "/" + name));
                        }
                        if (!sortedNames.contains(idName))
                            return Boolean.FALSE;

                        SortedSet<ZNodeName> lessThanMe = sortedNames.headSet(idName);
                        if (!lessThanMe.isEmpty()) {
                            ZNodeName lastChildName = lessThanMe.last();
                            String lastChildId = lastChildName.getName();
                            if (logger.isDebugEnabled()) {
                            	logger.debug(EELFLoggerDelegate.debugLogger, "watching less than me node: " + lastChildId);
                            }
                            Stat stat = zookeeper.exists(lastChildId, false);
                            if (stat != null) {
                                return Boolean.FALSE;
                            } else {
                                logger.info(EELFLoggerDelegate.applicationLogger,
                                                "Could not find the" + " stats for less than me: "
                                                                + lastChildName.getName());
                            }
                        } else
                            return Boolean.TRUE;
                    }
                }
            } while (id == null);
            return Boolean.FALSE;
        }

        /**
         * the command that is run and retried for actually obtaining the lock
         *
         * @return if the command was successful or not
         */
        public boolean execute() throws KeeperException, InterruptedException {
            do {
                if (id == null) {
                    String prefix = "x-";
                    byte[] data = {0x12, 0x34};
                    id = zookeeper.create(dir + "/" + prefix, data, getAcl(),
                                    CreateMode.PERSISTENT_SEQUENTIAL);

                    if (logger.isDebugEnabled()) {
                    	logger.debug(EELFLoggerDelegate.debugLogger, "Created id: " + id);
                    }
                    if (id != null) {
                        Stat stat = null;
                        try {
                            stat = zookeeper.exists(id, false);
                        } catch (KeeperException | InterruptedException e1) {
                            logger.error(EELFLoggerDelegate.errorLogger, "Error in execute: " + e1);
                        }
                        Long ctime = stat.getCtime();
                        MusicUtil.zkNodeMap.put(id, ctime);
                        PreparedQueryObject pQuery = new PreparedQueryObject();
                        pQuery.appendQueryString(
                                        "INSERT INTO admin.locks(lock_id, ctime) VALUES (?,?)");
                        try {
                            pQuery.addValue(MusicUtil.convertToActualDataType(DataType.text(), id));
                            pQuery.addValue(MusicUtil.convertToActualDataType(DataType.text(), ctime));
                            MusicCore.eventualPut(pQuery);
                        } catch (Exception e) {
                        	logger.error(EELFLoggerDelegate.errorLogger, "Error in execute: " + e);
                        }
                        break;
                   }
                }
                if (id != null) {
                    List<String> names = zookeeper.getChildren(dir, false);
                    if (names.isEmpty()) {
                        logger.info(EELFLoggerDelegate.applicationLogger, "No children in: " + dir
                                        + " when we've just " + "created one! Lets recreate it...");
                        // lets force the recreation of the id
                        id = null;
                        return Boolean.FALSE;

                    } else {
                        // lets sort them explicitly (though they do seem to come back in order
                        // ususally :)
                        ZNodeName idName = new ZNodeName(id);
                        SortedSet<ZNodeName> sortedNames = new TreeSet<ZNodeName>();
                        for (String name : names) {
                            sortedNames.add(new ZNodeName(dir + "/" + name));
                        }
                        if (!sortedNames.contains(idName))
                            return Boolean.FALSE;

                        SortedSet<ZNodeName> lessThanMe = sortedNames.headSet(idName);
                        if (!lessThanMe.isEmpty()) {
                            ZNodeName lastChildName = lessThanMe.last();
                            String lastChildId = lastChildName.getName();
                            if (logger.isDebugEnabled()) {
                            	logger.debug(EELFLoggerDelegate.debugLogger, "watching less than me node: " + lastChildId);
                            }
                            Stat stat = zookeeper.exists(lastChildId, false);
                            if (stat != null) {
                                return Boolean.FALSE;
                            } else {
                                logger.info(EELFLoggerDelegate.applicationLogger,
                                                "Could not find the" + " stats for less than me: "
                                                                + lastChildName.getName());
                            }
                        } else
                            return Boolean.TRUE;
                    }
                }
            } while (id == null);
            return Boolean.FALSE;
        }

Replace Generic With Diamond TreeSet<ZNodeName> with TreeSet<> in method public execute() : boolean from class org.onap.music.lockingservice.ZkStatelessLockService.LockZooKeeperOperation


    public synchronized String currentLockHolder(String mainLock) {
        final String id = mainLock;
        if (!isClosed() && id != null) {
            List<String> names;
            try {
                names = zookeeper.getChildren(id, false);
                if (names.isEmpty())
                    return "";
                SortedSet<ZNodeName> sortedNames = new TreeSet<>();
                for (String name : names) {
                    sortedNames.add(new ZNodeName(id + "/" + name));
                }
                return sortedNames.first().getName();
            } catch (InterruptedException e) {
            	logger.error(EELFLoggerDelegate.errorLogger, e.getMessage(),AppMessages.EXECUTIONINTERRUPTED, ErrorSeverity.ERROR, ErrorTypes.LOCKINGERROR);
                // set that we have been interrupted.
                Thread.currentThread().interrupt();
            } catch (KeeperException.NoNodeException e) {
                // do nothing
            } catch (KeeperException e) {
            	logger.error(EELFLoggerDelegate.errorLogger, e.getMessage(),AppMessages.KEEPERERROR, ErrorSeverity.ERROR, ErrorTypes.LOCKINGERROR);
                throw (RuntimeException) new RuntimeException(e.getMessage()).initCause(e);
            }
        }
        return "No lock holder!";
    }

    public synchronized String currentLockHolder(String mainLock) {
        final String id = mainLock;
        if (!isClosed() && id != null) {
            List<String> names;
            try {
                names = zookeeper.getChildren(id, false);
                if (names.isEmpty())
                    return "";
                SortedSet<ZNodeName> sortedNames = new TreeSet<ZNodeName>();
                for (String name : names) {
                    sortedNames.add(new ZNodeName(id + "/" + name));
                }
                return sortedNames.first().getName();
            } catch (InterruptedException e) {
            	logger.error(EELFLoggerDelegate.errorLogger, e.getMessage(),AppMessages.EXECUTIONINTERRUPTED, ErrorSeverity.ERROR, ErrorTypes.LOCKINGERROR);
                // set that we have been interrupted.
                Thread.currentThread().interrupt();
            } catch (KeeperException.NoNodeException e) {
                // do nothing
            } catch (KeeperException e) {
            	logger.error(EELFLoggerDelegate.errorLogger, e.getMessage(),AppMessages.KEEPERERROR, ErrorSeverity.ERROR, ErrorTypes.LOCKINGERROR);
                throw (RuntimeException) new RuntimeException(e.getMessage()).initCause(e);
            }
        }
        return "No lock holder!";
    }

Replace Generic With Diamond TreeSet<ZNodeName> with TreeSet<> in method public currentLockHolder(mainLock String) : String from class org.onap.music.lockingservice.ZkStatelessLockService


    /**
     * Ensures that the given path exists with the given data, ACL and flags
     *
     * @param path the lock path
     * @param data the data
     * @param acl list of ACLs applying to the path
     * @param flags create mode flags
     */
    protected void ensureExists(final String path, final byte[] data, final List<ACL> acl,
                    final CreateMode flags) {
        try {
            retryOperation(new ZooKeeperOperation() {
                public boolean execute() throws KeeperException, InterruptedException {
                    Stat stat = zookeeper.exists(path, false);
                    if (stat != null) {
                        return true;
                    }
                    zookeeper.create(path, data, acl, flags);
                    return true;
                }
            });
        } catch (InterruptedException|KeeperException e) {
            LOG.error(EELFLoggerDelegate.errorLogger,"Caught: " + e, e);
        }
    }

    /**
     * Ensures that the given path exists with the given data, ACL and flags
     *
     * @param path the lock path
     * @param data the data
     * @param acl list of ACLs applying to the path
     * @param flags create mode flags
     */
    protected void ensureExists(final String path, final byte[] data, final List<ACL> acl,
                    final CreateMode flags) {
        try {
            retryOperation(new ZooKeeperOperation() {
                public boolean execute() throws KeeperException, InterruptedException {
                    Stat stat = zookeeper.exists(path, false);
                    if (stat != null) {
                        return true;
                    }
                    zookeeper.create(path, data, acl, flags);
                    return true;
                }
            });
        } catch (KeeperException e) {
            LOG.error(EELFLoggerDelegate.errorLogger,"Caught: " + e, e);
        } catch (InterruptedException e) {
            LOG.error(EELFLoggerDelegate.errorLogger,"Caught: " + e, e);
        }
    }

Merge Catch [catch(KeeperException e), catch(InterruptedException e)] to catch(InterruptedException|KeeperException e) in method protected ensureExists(path String, data byte[], acl List<ACL>, flags CreateMode) : void from class org.onap.music.lockingservice.ProtocolSupport


  MnistImageReader(String fileName) {
    this.fileName = fileName;
    this.mnistData = new ArrayList<>();
    ReadFile();
    imagesIterator = mnistData.listIterator();
  }

  MnistImageReader(String fileName) {
    this.fileName = fileName;
    this.mnistData = new ArrayList<Integer>();
    ReadFile();
    imagesIterator = mnistData.listIterator();
  }

Replace Generic With Diamond ArrayList<Integer> with ArrayList<> in method package MnistImageReader(fileName String) from class MnistRepository.MnistImageReader


    /**
     * Crea un objeto TrabajoDetailedDTO a partir de un objeto TrabajoEntity
     * incluyendo los atributos de TrabajoDTO.
     *
     * @param entity Entidad TrabajoEntity desde la cual se va a crear el nuevo
     * objeto.
     *
     */
    public TrabajoDetailedDTO(TrabajoEntity entity) {
        super(entity);
        calificaciones = new ArrayList<>();

        if (entity.getCalificaciones() != null) {
            for (CalificacionEntity entityCalificaciones : entity.getCalificaciones()) {
                calificaciones.add(new CalificacionDTO(entityCalificaciones));
            }

        }
    }

    /**
     * Crea un objeto TrabajoDetailedDTO a partir de un objeto TrabajoEntity
     * incluyendo los atributos de TrabajoDTO.
     *
     * @param entity Entidad TrabajoEntity desde la cual se va a crear el nuevo
     * objeto.
     *
     */
    public TrabajoDetailedDTO(TrabajoEntity entity) {
        super(entity);
        calificaciones = new ArrayList<CalificacionDTO>();

        if (entity.getCalificaciones() != null) {
            for (CalificacionEntity entityCalificaciones : entity.getCalificaciones()) {
                calificaciones.add(new CalificacionDTO(entityCalificaciones));
            }

        }
    }

Replace Generic With Diamond ArrayList<CalificacionDTO> with ArrayList<> in method public TrabajoDetailedDTO(entity TrabajoEntity) from class co.edu.uniandes.csw.traducciones.dtos.TrabajoDetailedDTO


  private List<IdiomaDTO> idiomasListEntity2DTO(List<IdiomaEntity> entityList) {
        List<IdiomaDTO> list = new ArrayList<>();
        for (IdiomaEntity entity : entityList) {
            list.add(new IdiomaDTO(entity));
        }
        return list;
    }

  private List<IdiomaDTO> idiomasListEntity2DTO(List<IdiomaEntity> entityList) {
        List<IdiomaDTO> list = new ArrayList<IdiomaDTO>();
        for (IdiomaEntity entity : entityList) {
            list.add(new IdiomaDTO(entity));
        }
        return list;
    }

Replace Generic With Diamond ArrayList<IdiomaDTO> with ArrayList<> in method private idiomasListEntity2DTO(entityList List<IdiomaEntity>) : List<IdiomaDTO> from class co.edu.uniandes.csw.traducciones.resources.HojaDeVidaResource


    public static void main(String[] args) {
        List<Attachment> attachments = Arrays.asList(
                new Attachment("image 1", 100),
                new Attachment("image 2", 34),
                new Attachment("image 3", 13)
        );
        Comparator comparator = new Comparator() {
            @Override
            public int compare(Object o1, Object o2) {
                Attachment left = (Attachment) o1;
                Attachment right = (Attachment) o2;
                return left.getSize() - right.getSize();
            }
        };
        attachments.sort(comparator);
        System.out.println(attachments);
        Comparator<Attachment> comparatorName = new Comparator<>() {
            @Override
            public int compare(Attachment left, Attachment right) {
                return left.getName().compareTo(right.getName());
            }
        };
        attachments.sort(comparatorName);
        System.out.println(attachments);
    }

    public static void main(String[] args) {
        List<Attachment> attachments = Arrays.asList(
                new Attachment("image 1", 100),
                new Attachment("image 2", 34),
                new Attachment("image 3", 13)
        );
        Comparator comparator =  new Comparator() {
            @Override
            public int compare(Object o1, Object o2) {
                Attachment left = (Attachment) o1;
                Attachment right = (Attachment) o2;
                return left.getSize() - right.getSize();
            }
        };
        attachments.sort(comparator);
        System.out.println(attachments);
        Comparator<Attachment> comparatorName = new Comparator<Attachment>() {
            @Override
            public int compare(Attachment left, Attachment right) {
                return left.getName().compareTo(right.getName());
            }
        };
        attachments.sort(comparatorName);
        System.out.println(attachments);
    }

Replace Generic With Diamond Comparator<Attachment> with Comparator<> in method public main(args String[]) : void from class ru.job4j.collection.lambda.AttachmentSort


    private Task<Void> sleeperTask() {
        // A method that returns a task that waits X seconds, specified in logic variables,
        // needed when something needs to be shown for a moment and then removed
        return new Task<>() {
            @Override
            protected Void call() {
                try {
                    Thread.sleep(VariablesLogic.getInstance().getMessageShowUpTimeInMillis());
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                return null;
            }
        };
    }

    public Task<Void> sleeperTask() {
        return new Task<Void>() {
            @Override
            protected Void call() {
                try {
                    Thread.sleep(VariablesLogic.messageShowUpTimeInMillis);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                return null;
            }
        };
    }

Replace Generic With Diamond Task<Void> with Task<> in method private sleeperTask() : Task<Void> from class graphic.GraphicManager


    void loadPropertiesFromClassPath(String pathStr, String propertiesFileName) throws FileNotFoundException {
        String filePathStr = Paths.get(pathStr, propertiesFileName).toString();
        URL res = this.getClass().getClassLoader().getResource(filePathStr);
        try (InputStream in = res.openStream()) {
            Properties properties = new Properties();
            properties.load(in);
            logSourceFilePathAndProperties(res.toString(), properties);
            putAll((Map) properties);
        } catch (NullPointerException | IOException e) {
            throw new FileNotFoundException(String.format(FAILED_TO_LOAD_PROPERTIES_FROM_CLASS_PATH_MSG_TEMPLATE, PATH_TYPE.CLASSPATH_PREFIX, propertiesFileName, pathStr));
        }
    }

    void loadPropertiesFromClassPath(String pathStr, String propertiesFileName) throws FileNotFoundException {
        String filePathStr = Paths.get(pathStr, propertiesFileName).toString();
        URL res = this.getClass().getClassLoader().getResource(filePathStr);
        try {
            Properties properties = new Properties();
            properties.load(res.openStream());
            logSourceFilePathAndProperties(res.toString(), properties);
            putAll((Map) properties);
        } catch (NullPointerException | IOException e) {
            throw new FileNotFoundException(String.format(FAILED_TO_LOAD_PROPERTIES_FROM_CLASS_PATH_MSG_TEMPLATE, PATH_TYPE.CLASSPATH_PREFIX, propertiesFileName, pathStr));
        }
    }

Try With Resources try(InputStream in=res.openStream()) in method package loadPropertiesFromClassPath(pathStr String, propertiesFileName String) : void from class com.lyders.properties.ApplicationProperties


  /**
   * Generates an iterator to allow the array processing in loops.
   *
   * @return an iterator for the array
   */
  @Override
  public Iterator<T> iterator() {
    return new Iterator<>() {
      private int index = 0;

      @Override
      public boolean hasNext() {
        return this.index < size();
      }

      @Override
      public T next() {
        if (this.index >= size()) {
          throw new NoSuchElementException(this.index + ">=" + size());
        }
        return getElementAt(this.index++);
      }

      @Override
      public void remove() {
        throw new UnsupportedOperationException("Removing is unsupported here");
      }

    };
  }

  /**
   * Generates an iterator to allow the array processing in loops.
   *
   * @return an iterator for the array
   */
  @Override
  public Iterator<T> iterator() {
    return new Iterator<T>() {
      private int index = 0;

      @Override
      public boolean hasNext() {
        return this.index < size();
      }

      @Override
      public T next() {
        if (this.index >= size()) {
          throw new NoSuchElementException(this.index + ">=" + size());
        }
        return getElementAt(this.index++);
      }

      @Override
      public void remove() {
        throw new UnsupportedOperationException("Removing is unsupported here");
      }

    };
  }

Replace Generic With Diamond Iterator<T> with Iterator<> in method public iterator() : Iterator<T> from class com.igormaznitsa.jbbp.model.JBBPAbstractArrayField


  /**
   * Case 09-jun-2020
   * Example how to use external variable value provider.
   *
   * @throws Exception for any error
   */
  @Test
  public void testByteArrayWhichLengthProvidedExternally() throws Exception {
    class BKlazz {
      @Bin(order = 1, type = BinType.BYTE_ARRAY)
      byte[] a;
      @Bin(order = 2, type = BinType.BYTE_ARRAY)
      byte[] b;
      @Bin(order = 3, type = BinType.BYTE_ARRAY)
      byte[] c;
    }

    JBBPParser parser = JBBPParser.prepare("byte [$alen] a; byte [$blen] b; byte [$clen] c;");

    BKlazz parsed = parser.parse(new byte[] {1, 2, 3}, null,
        (fieldName, numericFieldMap, compiledBlock) -> {
          if ("alen".equals(fieldName)) {
            return 0;
          } else if ("blen".equals(fieldName)) {
            return 3;
          } else if ("clen".equals(fieldName)) {
            return 0;
          } else {
            throw new IllegalArgumentException("Unknown name: " + fieldName);
          }

        }).mapTo(new BKlazz());

    assertArrayEquals(new byte[0], parsed.a);
    assertArrayEquals(new byte[] {1, 2, 3}, parsed.b);
    assertArrayEquals(new byte[0], parsed.c);
  }

  /**
   * Case 09-jun-2020
   * Example how to use external variable value provider.
   *
   * @throws Exception for any error
   */
  @Test
  public void testByteArrayWhichLengthProvidedExternally() throws Exception {
    class BKlazz {
      @Bin(order = 1, type = BinType.BYTE_ARRAY)
      byte[] a;
      @Bin(order = 2, type = BinType.BYTE_ARRAY)
      byte[] b;
      @Bin(order = 3, type = BinType.BYTE_ARRAY)
      byte[] c;
    }

    JBBPParser parser = JBBPParser.prepare("byte [$alen] a; byte [$blen] b; byte [$clen] c;");

    BKlazz parsed = parser.parse(new byte[] {1, 2, 3}, null, new JBBPExternalValueProvider() {
      @Override
      public int provideArraySize(String fieldName,
                                  JBBPNamedNumericFieldMap numericFieldMap,
                                  JBBPCompiledBlock compiledBlock) {
        if ("alen".equals(fieldName)) {
          return 0;
        } else if ("blen".equals(fieldName)) {
          return 3;
        } else if ("clen".equals(fieldName)) {
          return 0;
        } else {
          throw new IllegalArgumentException("Unknown name: " + fieldName);
        }

      }
    }).mapTo(new BKlazz());

    assertArrayEquals(new byte[0], parsed.a);
    assertArrayEquals(new byte[] {1, 2, 3}, parsed.b);
    assertArrayEquals(new byte[0], parsed.c);
  }

Replace Anonymous With Lambda com.igormaznitsa.jbbp.it.BasedOnQuestionsAndCasesTest.testByteArrayWhichLengthProvidedExternally.parsed.mapTo.parse.new JBBPExternalValueProvider with (fieldName, numericFieldMap, compiledBlock) -> {if("alen".equals(fieldName)){return 0; in method public testByteArrayWhichLengthProvidedExternally() : void from class com.igormaznitsa.jbbp.it.BasedOnQuestionsAndCasesTest


  /**
   * A Constructor.
   *
   * @param externalValueProvider an external value provider, it can be null
   */
  public JBBPNamedNumericFieldMap(final JBBPExternalValueProvider externalValueProvider) {
    this.fieldMap = new LinkedHashMap<>();
    this.externalValueProvider = externalValueProvider;
  }

  /**
   * A Constructor.
   *
   * @param externalValueProvider an external value provider, it can be null
   */
  public JBBPNamedNumericFieldMap(final JBBPExternalValueProvider externalValueProvider) {
    this.fieldMap = new LinkedHashMap<JBBPNamedFieldInfo, JBBPNumericField>();
    this.externalValueProvider = externalValueProvider;
  }

Replace Generic With Diamond LinkedHashMap<JBBPNamedFieldInfo,JBBPNumericField> with LinkedHashMap<> in method public JBBPNamedNumericFieldMap(externalValueProvider JBBPExternalValueProvider) from class com.igormaznitsa.jbbp.JBBPNamedNumericFieldMap


  /**
   * Constructor.
   *
   * @param str                      a string to be parsed, must not be null.
   * @param customFieldTypeProcessor custom field type processor, it can be null
   */
  public JBBPTokenizer(final String str, final JBBPCustomFieldTypeProcessor customFieldTypeProcessor) {
    JBBPUtils.assertNotNull(str, "String must not be null");

    if (customFieldTypeProcessor == null) {
      this.reservedTypeNames = GLOBAL_RESERVED_TYPE_NAMES;
    } else {
      this.reservedTypeNames = new HashSet<>(GLOBAL_RESERVED_TYPE_NAMES);
      for (final String customType : customFieldTypeProcessor.getCustomFieldTypes()) {
        JBBPUtils.assertNotNull(customType, "Type must not be null");
        this.reservedTypeNames.add(customType);
      }
    }

    this.processingString = str;
    this.matcher = PATTERN.matcher(this.processingString);
    readNextItem();
  }

  /**
   * Constructor.
   *
   * @param str                      a string to be parsed, must not be null.
   * @param customFieldTypeProcessor custom field type processor, it can be null
   */
  public JBBPTokenizer(final String str, final JBBPCustomFieldTypeProcessor customFieldTypeProcessor) {
    JBBPUtils.assertNotNull(str, "String must not be null");

    if (customFieldTypeProcessor == null) {
      this.reservedTypeNames = GLOBAL_RESERVED_TYPE_NAMES;
    } else {
      this.reservedTypeNames = new HashSet<String>(GLOBAL_RESERVED_TYPE_NAMES);
      for (final String customType : customFieldTypeProcessor.getCustomFieldTypes()) {
        JBBPUtils.assertNotNull(customType, "Type must not be null");
        this.reservedTypeNames.add(customType);
      }
    }

    this.processingString = str;
    this.matcher = PATTERN.matcher(this.processingString);
    readNextItem();
  }

Replace Generic With Diamond HashSet<String> with HashSet<> in method public JBBPTokenizer(str String, customFieldTypeProcessor JBBPCustomFieldTypeProcessor) from class com.igormaznitsa.jbbp.compiler.tokenizer.JBBPTokenizer


  /**
   * Map a structure to a class instance.
   *
   * @param rootStructure        a structure to be mapped, must not be null
   * @param mappingClassInstance a class instance to be destination for map
   *                             operations, must not be null
   * @param customFieldProcessor a custom field processor to provide custom
   *                             values, it can be null if there is not any mapping field desires the
   *                             processor
   * @param flags                special flags for mapping process
   * @return the processed class instance, the same which was the argument for
   * the method.
   * @throws JBBPMapperException for any error
   * @see #FLAG_IGNORE_MISSING_VALUES
   * @since 1.1
   */
  public static Object map(final JBBPFieldStruct rootStructure, final Object mappingClassInstance, final JBBPMapperCustomFieldProcessor customFieldProcessor, final int flags) {
    JBBPUtils.assertNotNull(rootStructure, "The Root structure must not be null");
    JBBPUtils.assertNotNull(mappingClassInstance, "The Mapping class instance must not be null");

    final Class<?> mappingClass = mappingClassInstance.getClass();

    final Bin defaultAnno = mappingClass.getAnnotation(Bin.class);

    // make chain of ancestors till java.lang.Object
    final List<Class<?>> listOfClassHierarchy = new ArrayList<>();
    Class<?> current = mappingClassInstance.getClass();
    while (current != java.lang.Object.class) {
      listOfClassHierarchy.add(current);
      current = current.getSuperclass();
    }

    for (final Class<?> processingClazz : listOfClassHierarchy) {
      for (Field mappingField : processingClazz.getDeclaredFields()) {
        final int modifiers = mappingField.getModifiers();
        if (Modifier.isTransient(modifiers) || Modifier.isStatic(modifiers)) {
          continue;
        }

        mappingField = ReflectUtils.makeAccessible(mappingField);

        final Bin fieldAnno = mappingField.getAnnotation(Bin.class);
        final Bin mappedAnno;
        if ((fieldAnno == null && defaultAnno == null) || mappingField.getName().indexOf('$') >= 0) {
          continue;
        }
        mappedAnno = fieldAnno == null ? defaultAnno : fieldAnno;

        if (mappedAnno.custom()) {
          JBBPUtils.assertNotNull(customFieldProcessor, "There is a custom mapping field, in the case you must provide a custom mapping field processor");
          final Object value = customFieldProcessor.prepareObjectForMapping(rootStructure, mappedAnno, mappingField);
          setFieldValue(mappingClassInstance, mappingField, null, value);
        } else {
          final BinType fieldType;

          final JBBPBitNumber mappedBitNumber = mappedAnno.outBitNumber();

          if (mappedAnno.type() == BinType.UNDEFINED) {
            BinType thetype = BinType.findCompatible(mappingField.getType());
            if (thetype == null) {
              throw new JBBPMapperException("Can't find compatible type for a mapping field", rootStructure, mappingClass, mappingField, null);
            } else if (mappedBitNumber.getBitNumber() < 8 && !(thetype == BinType.STRUCT || thetype == BinType.STRUCT_ARRAY)) {
              thetype = thetype.isArray() ? BinType.BIT_ARRAY : BinType.BIT;
            }
            fieldType = thetype;
          } else {
            fieldType = mappedAnno.type();
          }
          final boolean bitWideField = fieldType == BinType.BIT || fieldType == BinType.BIT_ARRAY;

          final String fieldName = mappedAnno.name().length() == 0 ? mappingField.getName() : mappedAnno.name();
          final String fieldPath = mappedAnno.path();

          final JBBPAbstractField binField;

          if (fieldPath.length() == 0) {
            binField = fieldName.length() == 0 ? rootStructure.findFieldForType(fieldType.getFieldClass()) : rootStructure.findFieldForNameAndType(fieldName, fieldType.getFieldClass());
          } else {
            binField = rootStructure.findFieldForPathAndType(fieldPath, fieldType.getFieldClass());
          }

          if (binField == null) {
            if ((flags & FLAG_IGNORE_MISSING_VALUES) != 0) {
              continue;
            }
            throw new JBBPMapperException("Can't find value to be mapped to a mapping field [" + mappingField + ']', null, mappingClass, mappingField, null);
          }

          if (bitWideField && mappedBitNumber != JBBPBitNumber.BITS_8 && ((BitEntity) binField).getBitWidth() != mappedBitNumber) {
            throw new JBBPMapperException("Can't map value to a mapping field for different field bit width [" + mappedBitNumber + "!=" + ((BitEntity) binField).getBitWidth().getBitNumber() + ']', null, mappingClass, mappingField, null);
          }

          if (mappingField.getType().isArray()) {
            if (binField instanceof JBBPAbstractArrayField) {
              if (binField instanceof JBBPFieldArrayStruct) {
                // structure
                final JBBPFieldArrayStruct structArray = (JBBPFieldArrayStruct) binField;
                final Class<?> componentType = mappingField.getType().getComponentType();

                Object valueArray = getFieldValue(mappingClassInstance, mappingField);

                valueArray = valueArray == null ? Array.newInstance(componentType, structArray.size()) : valueArray;

                if (Array.getLength(valueArray) != structArray.size()) {
                  throw new JBBPMapperException("Can't map an array field for different expected size [" + Array.getLength(valueArray) + "!=" + structArray.size() + ']', binField, mappingClass, mappingField, null);
                }

                for (int i = 0; i < structArray.size(); i++) {
                  final Object curInstance = Array.get(valueArray, i);
                  if (curInstance == null) {
                    Array.set(valueArray, i, map(structArray.getElementAt(i), componentType, customFieldProcessor));
                  } else {
                    Array.set(valueArray, i, map(structArray.getElementAt(i), curInstance, customFieldProcessor));
                  }
                }
                setFieldValue(mappingClassInstance, mappingField, binField, valueArray);
              } else {
                // primitive
                mapArrayField(mappingClassInstance, mappingField, (JBBPAbstractArrayField<?>) binField, mappedAnno.bitOrder() == JBBPBitOrder.MSB0);
              }
            } else {
              throw new JBBPMapperException("Can't map a non-array value to an array mapping field", binField, mappingClass, mappingField, null);
            }
          } else {
            if (binField instanceof JBBPNumericField) {
              mapNumericField(mappingClassInstance, mappingField, (JBBPNumericField) binField, mappedAnno.bitOrder() == JBBPBitOrder.MSB0);
            } else if (binField instanceof JBBPFieldString) {
              if (mappingField.getType().isPrimitive()) {
                throw new JBBPMapperException("Can't map a string to a primitive mapping field", binField, mappingClass, mappingField, null);
              } else {
                setFieldValue(mappingClassInstance, mappingField, binField, ((JBBPFieldString)binField).getAsString());
              }
            } else if (binField instanceof JBBPFieldStruct) {
              if (mappingField.getType().isPrimitive()) {
                throw new JBBPMapperException("Can't map a structure to a primitive mapping field", binField, mappingClass, mappingField, null);
              } else {
                final Object curValue = getFieldValue(mappingClassInstance, mappingField);
                if (curValue == null) {
                  setFieldValue(mappingClassInstance, mappingField, binField, map((JBBPFieldStruct) binField, mappingField.getType(), customFieldProcessor));
                } else {
                  setFieldValue(mappingClassInstance, mappingField, binField, map((JBBPFieldStruct) binField, curValue, customFieldProcessor));
                }
              }
            } else {
              boolean processed = false;
              if (mappingField.getType() == String.class && binField instanceof JBBPAbstractArrayField) {
                final String convertedValue = convertFieldValueToString((JBBPAbstractArrayField<?>) binField);
                if (convertedValue != null) {
                  setFieldValue(mappingClassInstance, mappingField, binField, convertedValue);
                  processed = true;
                }
              }
              if (!processed) {
                throw new JBBPMapperException("Can't map a field for its value incompatibility", binField, mappingClass, mappingField, null);
              }
            }
          }
        }
      }
    }
    return mappingClassInstance;
  }

  /**
   * Map a structure to a class instance.
   *
   * @param rootStructure        a structure to be mapped, must not be null
   * @param mappingClassInstance a class instance to be destination for map
   *                             operations, must not be null
   * @param customFieldProcessor a custom field processor to provide custom
   *                             values, it can be null if there is not any mapping field desires the
   *                             processor
   * @param flags                special flags for mapping process
   * @return the processed class instance, the same which was the argument for
   * the method.
   * @throws JBBPMapperException for any error
   * @see #FLAG_IGNORE_MISSING_VALUES
   * @since 1.1
   */
  public static Object map(final JBBPFieldStruct rootStructure, final Object mappingClassInstance, final JBBPMapperCustomFieldProcessor customFieldProcessor, final int flags) {
    JBBPUtils.assertNotNull(rootStructure, "The Root structure must not be null");
    JBBPUtils.assertNotNull(mappingClassInstance, "The Mapping class instance must not be null");

    final Class<?> mappingClass = mappingClassInstance.getClass();

    final Bin defaultAnno = mappingClass.getAnnotation(Bin.class);

    // make chain of ancestors till java.lang.Object
    final List<Class<?>> listOfClassHierarchy = new ArrayList<Class<?>>();
    Class<?> current = mappingClassInstance.getClass();
    while (current != java.lang.Object.class) {
      listOfClassHierarchy.add(current);
      current = current.getSuperclass();
    }

    for (final Class<?> processingClazz : listOfClassHierarchy) {
      for (Field mappingField : processingClazz.getDeclaredFields()) {
        final int modifiers = mappingField.getModifiers();
        if (Modifier.isTransient(modifiers) || Modifier.isStatic(modifiers)) {
          continue;
        }

        mappingField = ReflectUtils.makeAccessible(mappingField);

        final Bin fieldAnno = mappingField.getAnnotation(Bin.class);
        final Bin mappedAnno;
        if ((fieldAnno == null && defaultAnno == null) || mappingField.getName().indexOf('$') >= 0) {
          continue;
        }
        mappedAnno = fieldAnno == null ? defaultAnno : fieldAnno;

        if (mappedAnno.custom()) {
          JBBPUtils.assertNotNull(customFieldProcessor, "There is a custom mapping field, in the case you must provide a custom mapping field processor");
          final Object value = customFieldProcessor.prepareObjectForMapping(rootStructure, mappedAnno, mappingField);
          setFieldValue(mappingClassInstance, mappingField, null, value);
        } else {
          final BinType fieldType;

          final JBBPBitNumber mappedBitNumber = mappedAnno.outBitNumber();

          if (mappedAnno.type() == BinType.UNDEFINED) {
            BinType thetype = BinType.findCompatible(mappingField.getType());
            if (thetype == null) {
              throw new JBBPMapperException("Can't find compatible type for a mapping field", rootStructure, mappingClass, mappingField, null);
            } else if (mappedBitNumber.getBitNumber() < 8 && !(thetype == BinType.STRUCT || thetype == BinType.STRUCT_ARRAY)) {
              thetype = thetype.isArray() ? BinType.BIT_ARRAY : BinType.BIT;
            }
            fieldType = thetype;
          } else {
            fieldType = mappedAnno.type();
          }
          final boolean bitWideField = fieldType == BinType.BIT || fieldType == BinType.BIT_ARRAY;

          final String fieldName = mappedAnno.name().length() == 0 ? mappingField.getName() : mappedAnno.name();
          final String fieldPath = mappedAnno.path();

          final JBBPAbstractField binField;

          if (fieldPath.length() == 0) {
            binField = fieldName.length() == 0 ? rootStructure.findFieldForType(fieldType.getFieldClass()) : rootStructure.findFieldForNameAndType(fieldName, fieldType.getFieldClass());
          } else {
            binField = rootStructure.findFieldForPathAndType(fieldPath, fieldType.getFieldClass());
          }

          if (binField == null) {
            if ((flags & FLAG_IGNORE_MISSING_VALUES) != 0) {
              continue;
            }
            throw new JBBPMapperException("Can't find value to be mapped to a mapping field [" + mappingField + ']', null, mappingClass, mappingField, null);
          }

          if (bitWideField && mappedBitNumber != JBBPBitNumber.BITS_8 && ((BitEntity) binField).getBitWidth() != mappedBitNumber) {
            throw new JBBPMapperException("Can't map value to a mapping field for different field bit width [" + mappedBitNumber + "!=" + ((BitEntity) binField).getBitWidth().getBitNumber() + ']', null, mappingClass, mappingField, null);
          }

          if (mappingField.getType().isArray()) {
            if (binField instanceof JBBPAbstractArrayField) {
              if (binField instanceof JBBPFieldArrayStruct) {
                // structure
                final JBBPFieldArrayStruct structArray = (JBBPFieldArrayStruct) binField;
                final Class<?> componentType = mappingField.getType().getComponentType();

                Object valueArray = getFieldValue(mappingClassInstance, mappingField);

                valueArray = valueArray == null ? Array.newInstance(componentType, structArray.size()) : valueArray;

                if (Array.getLength(valueArray) != structArray.size()) {
                  throw new JBBPMapperException("Can't map an array field for different expected size [" + Array.getLength(valueArray) + "!=" + structArray.size() + ']', binField, mappingClass, mappingField, null);
                }

                for (int i = 0; i < structArray.size(); i++) {
                  final Object curInstance = Array.get(valueArray, i);
                  if (curInstance == null) {
                    Array.set(valueArray, i, map(structArray.getElementAt(i), componentType, customFieldProcessor));
                  } else {
                    Array.set(valueArray, i, map(structArray.getElementAt(i), curInstance, customFieldProcessor));
                  }
                }
                setFieldValue(mappingClassInstance, mappingField, binField, valueArray);
              } else {
                // primitive
                mapArrayField(mappingClassInstance, mappingField, (JBBPAbstractArrayField<?>) binField, mappedAnno.bitOrder() == JBBPBitOrder.MSB0);
              }
            } else {
              throw new JBBPMapperException("Can't map a non-array value to an array mapping field", binField, mappingClass, mappingField, null);
            }
          } else {
            if (binField instanceof JBBPNumericField) {
              mapNumericField(mappingClassInstance, mappingField, (JBBPNumericField) binField, mappedAnno.bitOrder() == JBBPBitOrder.MSB0);
            } else if (binField instanceof JBBPFieldString) {
              if (mappingField.getType().isPrimitive()) {
                throw new JBBPMapperException("Can't map a string to a primitive mapping field", binField, mappingClass, mappingField, null);
              } else {
                setFieldValue(mappingClassInstance, mappingField, binField, ((JBBPFieldString)binField).getAsString());
              }
            } else if (binField instanceof JBBPFieldStruct) {
              if (mappingField.getType().isPrimitive()) {
                throw new JBBPMapperException("Can't map a structure to a primitive mapping field", binField, mappingClass, mappingField, null);
              } else {
                final Object curValue = getFieldValue(mappingClassInstance, mappingField);
                if (curValue == null) {
                  setFieldValue(mappingClassInstance, mappingField, binField, map((JBBPFieldStruct) binField, mappingField.getType(), customFieldProcessor));
                } else {
                  setFieldValue(mappingClassInstance, mappingField, binField, map((JBBPFieldStruct) binField, curValue, customFieldProcessor));
                }
              }
            } else {
              boolean processed = false;
              if (mappingField.getType() == String.class && binField instanceof JBBPAbstractArrayField) {
                final String convertedValue = convertFieldValueToString((JBBPAbstractArrayField<?>) binField);
                if (convertedValue != null) {
                  setFieldValue(mappingClassInstance, mappingField, binField, convertedValue);
                  processed = true;
                }
              }
              if (!processed) {
                throw new JBBPMapperException("Can't map a field for its value incompatibility", binField, mappingClass, mappingField, null);
              }
            }
          }
        }
      }
    }
    return mappingClassInstance;
  }

Replace Generic With Diamond ArrayList<Class<?>> with ArrayList<> in method public map(rootStructure JBBPFieldStruct, mappingClassInstance Object, customFieldProcessor JBBPMapperCustomFieldProcessor, flags int) : Object from class com.igormaznitsa.jbbp.mapper.JBBPMapper


  @Override
  public <T> T makeClassInstance(final Class<T> klazz) throws InstantiationException {
    try {
      if (isInnerClass(klazz) || klazz.isLocalClass()) {
        final Class<?> declaringClass = klazz.getEnclosingClass();
        final Constructor<?> constructor = findConstructorForInnerClass(klazz, declaringClass);
        constructor.setAccessible(true);
        return klazz.cast(constructor.newInstance(makeStubForConstructor(constructor.getParameterTypes())));
      } else {
        final Constructor<?> constructor = findConstructorForStaticClass(klazz);
        constructor.setAccessible(true);
        return klazz.cast(constructor.newInstance(makeStubForConstructor(constructor.getParameterTypes())));
      }
    } catch (SecurityException ex) {
      throw new InstantiationException("Can't get access to the default constructor for class '" + klazz.getName() + "\' [" + ex + ']');
    } catch (IllegalArgumentException | InvocationTargetException ex) {
      throw new InstantiationException("Can't make class '" + klazz.getName() + "\' [" + ex + ']');
    } catch (IllegalAccessException ex) {
      throw new InstantiationException("Can't make instance of class '" + klazz.getName() + "' for access exception [" + ex + ']');
    }
  }

  @Override
  public <T> T makeClassInstance(final Class<T> klazz) throws InstantiationException {
    try {
      if (isInnerClass(klazz) || klazz.isLocalClass()) {
        final Class<?> declaringClass = klazz.getEnclosingClass();
        final Constructor<?> constructor = findConstructorForInnerClass(klazz, declaringClass);
        constructor.setAccessible(true);
        return klazz.cast(constructor.newInstance(makeStubForConstructor(constructor.getParameterTypes())));
      } else {
        final Constructor<?> constructor = findConstructorForStaticClass(klazz);
        constructor.setAccessible(true);
        return klazz.cast(constructor.newInstance(makeStubForConstructor(constructor.getParameterTypes())));
      }
    } catch (SecurityException ex) {
      throw new InstantiationException("Can't get access to the default constructor for class '" + klazz.getName() + "\' [" + ex + ']');
    } catch (IllegalArgumentException ex) {
      throw new InstantiationException("Can't make class '" + klazz.getName() + "\' [" + ex + ']');
    } catch (InvocationTargetException ex) {
      throw new InstantiationException("Can't make class '" + klazz.getName() + "\' [" + ex + ']');
    } catch (IllegalAccessException ex) {
      throw new InstantiationException("Can't make instance of class '" + klazz.getName() + "' for access exception [" + ex + ']');
    }
  }

Merge Catch [catch(IllegalArgumentException ex), catch(InvocationTargetException ex)] to catch(IllegalArgumentException|InvocationTargetException ex) in method public makeClassInstance(klazz Class<T>) : T from class com.igormaznitsa.jbbp.mapper.instantiators.JBBPSafeInstantiator


  @Override
  public <T> T makeClassInstance(final Class<T> klazz) throws InstantiationException {
    JBBPUtils.assertNotNull(klazz, "Class must not be null");
    try {
      return klazz.cast(ALLOCATE_INSTANCE_METHOD.invoke(SUN_MISC_UNSAFE, klazz));
    } catch (InvocationTargetException ex) {
      final Throwable cause = ex.getTargetException();
      if (cause instanceof InstantiationException) {
        throw (InstantiationException) cause;
      } else {
        throw new InstantiationException("Can't instantiate class for exception [" + ex + ']');
      }
    } catch (IllegalAccessException | IllegalArgumentException ex) {
      throw new InstantiationException("Can't instantiate class for exception [" + ex + ']');
    }
  }

  @Override
  public <T> T makeClassInstance(final Class<T> klazz) throws InstantiationException {
    JBBPUtils.assertNotNull(klazz, "Class must not be null");
    try {
      return klazz.cast(ALLOCATE_INSTANCE_METHOD.invoke(SUN_MISC_UNSAFE, klazz));
    } catch (InvocationTargetException ex) {
      final Throwable cause = ex.getTargetException();
      if (cause instanceof InstantiationException) {
        throw (InstantiationException) cause;
      } else {
        throw new InstantiationException("Can't instantiate class for exception [" + ex + ']');
      }
    } catch (IllegalAccessException ex) {
      throw new InstantiationException("Can't instantiate class for exception [" + ex + ']');
    } catch (IllegalArgumentException ex) {
      throw new InstantiationException("Can't instantiate class for exception [" + ex + ']');
    }
  }

Merge Catch [catch(IllegalAccessException ex), catch(IllegalArgumentException ex)] to catch(IllegalAccessException|IllegalArgumentException ex) in method public makeClassInstance(klazz Class<T>) : T from class com.igormaznitsa.jbbp.mapper.instantiators.JBBPUnsafeInstantiator


  /**
   * Constructor.
   *
   * @param processors processors which should be joined.
   */
  public JBBPCustomFieldTypeProcessorAggregator(final JBBPCustomFieldTypeProcessor... processors) {
    this.customTypeMap = new HashMap<>();
    for (final JBBPCustomFieldTypeProcessor p : processors) {
      for (final String s : p.getCustomFieldTypes()) {
        JBBPUtils.assertNotNull(s, "Type must not be null");
        if (this.customTypeMap.containsKey(s)) {
          throw new IllegalArgumentException("Detected duplicated field type [" + s + ']');
        }
        this.customTypeMap.put(s, p);
      }
    }
    this.types = this.customTypeMap.keySet().toArray(ARRAY_STRING_EMPTY);
  }

  /**
   * Constructor.
   *
   * @param processors processors which should be joined.
   */
  public JBBPCustomFieldTypeProcessorAggregator(final JBBPCustomFieldTypeProcessor... processors) {
    this.customTypeMap = new HashMap<String, JBBPCustomFieldTypeProcessor>();
    for (final JBBPCustomFieldTypeProcessor p : processors) {
      for (final String s : p.getCustomFieldTypes()) {
        JBBPUtils.assertNotNull(s, "Type must not be null");
        if (this.customTypeMap.containsKey(s)) {
          throw new IllegalArgumentException("Detected duplicated field type [" + s + ']');
        }
        this.customTypeMap.put(s, p);
      }
    }
    this.types = this.customTypeMap.keySet().toArray(ARRAY_STRING_EMPTY);
  }

Replace Generic With Diamond HashMap<String,JBBPCustomFieldTypeProcessor> with HashMap<> in method public JBBPCustomFieldTypeProcessorAggregator(processors JBBPCustomFieldTypeProcessor...) from class com.igormaznitsa.jbbp.utils.JBBPCustomFieldTypeProcessorAggregator