    public static void toExcel() {
        try (Workbook workbook = new XSSFWorkbook()) {
            Sheet sheet = workbook.createSheet("Chart sheet");
            Row row = sheet.createRow(0);
            Cell cell = row.createCell(0);
            cell.setCellValue("SNM");
            cell = row.createCell(1);
            cell.setCellValue("Duration");
            int rownum = 1;
            for (int i = 8; i < 32; i++) {
                Subnet s = new Subnet("0.0.0.0/" + i);
                long dur = perfTest(s, new HashSet<>());
                row = sheet.createRow(rownum++);
                cell = row.createCell(0);
                cell.setCellValue(i);
                cell = row.createCell(1);
                cell.setCellValue((double) dur / 1000);
            }
            XSSFDrawing drawing = (XSSFDrawing) sheet.createDrawingPatriarch();
            XSSFClientAnchor anchor = drawing.createAnchor(0, 0, 0, 0, 5, 5, 15, 20);
            XSSFChart chart = drawing.createChart(anchor);
            XDDFChartLegend legend = chart.getOrAddLegend();
            legend.setPosition(LegendPosition.BOTTOM);
            XDDFCategoryAxis bottomAxis = chart.createCategoryAxis(AxisPosition.BOTTOM);
            XDDFValueAxis leftAxis = chart.createValueAxis(AxisPosition.LEFT);
            XDDFLineChartData data = (XDDFLineChartData) chart.createData(ChartTypes.LINE, bottomAxis, leftAxis);
            chart.setTitleText("Duration of contains()");
            chart.setTitleOverlay(false);
            bottomAxis.setTitle("SNM");
            leftAxis.setTitle("Duration in Microseconds");
            XDDFDataSource<String> xs = XDDFDataSourcesFactory.fromStringCellRange((XSSFSheet) sheet, new CellRangeAddress(1, 24, 0, 0));
            data.addSeries(xs, XDDFDataSourcesFactory.fromNumericCellRange((XSSFSheet) sheet, new CellRangeAddress(1, 24, 1, 1)));
            chart.plot(data);
            try (OutputStream fileOut = new FileOutputStream("workbook.xlsx")) {
                workbook.write(fileOut);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void toExcel() {
        try {
            Workbook workbook = new XSSFWorkbook();
            Sheet sheet = workbook.createSheet("Chart sheet");

            // Create a row and put some cells in it. Rows are 0 based.
            Row row = sheet.createRow(0);
            Cell cell = row.createCell(0);
            cell.setCellValue("SNM");
            cell = row.createCell(1);
            cell.setCellValue("Duration");

            int rownum = 1;
            for (int i = 8; i < 32; i++) {
                Subnet s = new Subnet("0.0.0.0/" + i);
                long dur = perfTest(s, new HashSet<>());
                row = sheet.createRow(rownum++);
                cell = row.createCell(0);
                cell.setCellValue(i);
                cell = row.createCell(1);
                cell.setCellValue((double) dur / 1000);
            }

            XSSFDrawing drawing = (XSSFDrawing) sheet.createDrawingPatriarch();
            XSSFClientAnchor anchor = drawing.createAnchor(0, 0, 0, 0, 5, 5, 15, 20);

            XSSFChart chart = drawing.createChart(anchor);
            XDDFChartLegend legend = chart.getOrAddLegend();
            legend.setPosition(LegendPosition.BOTTOM);

            XDDFCategoryAxis bottomAxis = chart.createCategoryAxis(AxisPosition.BOTTOM);
            XDDFValueAxis leftAxis = chart.createValueAxis(AxisPosition.LEFT);
            XDDFLineChartData data = (XDDFLineChartData) chart.createData(ChartTypes.LINE, bottomAxis, leftAxis);
            chart.setTitleText("Duration of contains()");
            chart.setTitleOverlay(false);
            bottomAxis.setTitle("SNM");
            leftAxis.setTitle("Duration");
            XDDFDataSource<String> xs = XDDFDataSourcesFactory.fromStringCellRange((XSSFSheet) sheet, new CellRangeAddress(1, 24, 0, 0));
            data.addSeries(xs, XDDFDataSourcesFactory.fromNumericCellRange((XSSFSheet) sheet, new CellRangeAddress(1, 24, 1, 1)));
            chart.plot(data);

            try (OutputStream fileOut = new FileOutputStream("workbook.xlsx")) {
                workbook.write(fileOut);
            }

            workbook.close();

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

Try With Resources try(Workbook workbook=new XSSFWorkbook()) in method public toExcel() : void from class tests.Tests


  private static String fetchLocalIp() throws Exception {
    try (final DatagramSocket socket = new DatagramSocket()) {
      socket.connect(InetAddress.getByName("8.8.8.8"), 80);
      String ip = socket.getLocalAddress().getHostAddress();
      logger.info("Got local IP address as {}", ip);
      return ip;
    } catch (Exception e) {
      logger.error("Unable to fetch the host's local IP", e);
      throw new Exception("Unable to fetch the host's local IP", e);
    }
  }

  private static String getMyIP() {
    Socket socket = new Socket();
    try {
      socket.connect(new InetSocketAddress("google.com", 80));
      String ip = socket.getLocalAddress().getHostAddress();
      logger.info("Got local IP as: {}", ip);
      return ip;
    } catch (Exception e) {
      return null;
    } finally {
      try {
        socket.close();
      } catch (Exception e) {

      }
    }
  }

Try With Resources try(final DatagramSocket socket=new DatagramSocket()) in method private fetchLocalIp() : String from class io.github.gravetii.client.DiztlClient


    public Map(ScenarioPercepts scenarioPercepts, List<MapObject> mapObjects, List<EffectArea> effects,
               int width, int height)
    {
        this.scenarioPercepts = scenarioPercepts;

        this.mapObjects = mapObjects;
        this.mapEffects = effects;

        this.width = width;
        this.height = height;

        this.quadTree = new QuadTree<>(width, height, MapObject::getContainer);
        mapObjects.forEach(o -> quadTree.add(o));
        System.out.print("");
    }

    public Map(ScenarioPercepts scenarioPercepts, List<MapObject> mapObjects, List<EffectArea> effects,
               int width, int height)
    {
        this.scenarioPercepts = scenarioPercepts;

        this.mapObjects = mapObjects;
        this.mapEffects = effects;

        this.width = width;
        this.height = height;

        this.quadTree = new QuadTree<MapObject>(width, height, new QuadTree.TransferFunction<MapObject>() {
            @Override
            public PointContainer transfer(MapObject o) {
                return o.getContainer();
            }
        });
        mapObjects.forEach(o -> quadTree.add(o));
        System.out.print("");
    }

Replace Anonymous With Lambda Group9.map.Map.Map.new QuadTree<MapObject>.new QuadTree.TransferFunction<MapObject> with MapObject::getContainer in method public Map(scenarioPercepts ScenarioPercepts, mapObjects List<MapObject>, effects List<EffectArea>, width int, height int) from class Group9.map.Map


    public LintReport lint(LintOption lintOption){
        LintReport.LintReportBuilder reportBuilder = LintReport.LintReportBuilder.aLintReport();
        reportBuilder.start(LocalDateTime.now());
        reportBuilder.getProjectInitializationTimeBuilder().start(LocalDateTime.now());
        try(var service = new MyBatisProjectService(lintOption.getProjectPath(), lintOption.getConfigFileName() != null ? lintOption.getConfigFileName() : "")) {
            reportBuilder.getProjectInitializationTimeBuilder().end(LocalDateTime.now());
            reportBuilder.getParsingTimeBuilder().start(LocalDateTime.now());
            var config = service.getParsedConfig();
            reportBuilder.getParsingTimeBuilder().end(LocalDateTime.now());
            var diagnostics = new Diagnostics();
            List<MappedStatementReport> reportList;
            DiagnosisReport diagnosisReport = diagnostics.execute(config).build();
            reportBuilder.diagnosisReport(diagnosisReport);
            reportList = diagnosisReport.getReportList();
            reportBuilder.getPrintingTimeBuilder().start(LocalDateTime.now());
            for(var report : reportList) {
                System.out.println(String.format("\uD83C\uDFAF %s", report.getMapperStatement().getId()));
                if (report.getPhase().ordinal() == 0) {
                    System.out.println(String.format("  ⌛ Any phase hasn't run."));
                }
                if (report.getPhase().ordinal() >= 1) {
                    System.out.println(String.format("  ⌛ the first phase (%s) has finished.", SyntaxError.class.getSimpleName()));
                }
                if (report.getPhase().ordinal() >= 2) {
                    System.out.println(String.format("  ⌛ the second phase (%s) has finished.", UnresolvedJavaTypeError.class.getSimpleName()));
                }
                if (report.getPhase().ordinal() >= 3) {
                    System.out.println(String.format("  ⌛ the third phase (%s) has finished.", ObjectNameNotFoundError.class.getSimpleName()));
                }
                if (report.getPhase().ordinal() >= 4) {
                    System.out.println(String.format("  ⌛ the fourth phase (%s) has finished.", IncompatibleTypeError.class.getSimpleName()));
                }
                System.out.println(String.format("  ✅ Diagnosis has finished."));
                if(report.getSyntaxErrorReport() != null){
                    for(var value : report.getSyntaxErrorReport().getErrorList()){
                        System.out.println(String.format("    🔨\uD83C\uDD82 %s", (lintOption.getPrintLevel() == LogLevel.Summary ? value.getSummary() : value.getDetails())));
                    }
                }
                if(report.getUnresolvedJavaTypeErrorReport() != null){
                    for(var value : report.getUnresolvedJavaTypeErrorReport().getErrorList()){
                        System.out.println(String.format("    🔨\uD83C\uDD84 %s", (lintOption.getPrintLevel() == LogLevel.Summary ? value.getSummary() : value.getDetails())));
                    }
                }
                if(report.getObjectNameNotFoundErrorReport() != null){
                    for(var value : report.getObjectNameNotFoundErrorReport().getErrorList()){
                        System.out.println(String.format("    🔨\uD83C\uDD7E %s", (lintOption.getPrintLevel() == LogLevel.Summary ? value.getSummary() : value.getDetails())));
                    }
                }
                if(report.getIncomptatibleTypeErrorReport() != null){
                    for(var value : report.getIncomptatibleTypeErrorReport().getErrorList()){
                        System.out.println(String.format("    🔨\uD83C\uDD78 %s", (lintOption.getPrintLevel() == LogLevel.Summary ? value.getSummary() : value.getDetails())));
                    }
                }
            }
            reportBuilder.getPrintingTimeBuilder().end(LocalDateTime.now());
        } catch (ConfigNotFoundException e) {
            e.printStackTrace();
        } catch (MyBatisProjectInitializationException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            reportBuilder.end(LocalDateTime.now());
        }
        return reportBuilder.build();
    }

    public LintReport lint(LintOption lintOption){
        LintReport.LintReportBuilder reportBuilder = LintReport.LintReportBuilder.aLintReport();
        reportBuilder.start(LocalDateTime.now());
        reportBuilder.getProjectInitializationTimeBuilder().start(LocalDateTime.now());
        var service = new MyBatisProjectService();
        try {
            service.initialize(lintOption.getProjectPath(), lintOption.getConfigFileName() != null ? lintOption.getConfigFileName() : "");
            reportBuilder.getProjectInitializationTimeBuilder().end(LocalDateTime.now());
            reportBuilder.getParsingTimeBuilder().start(LocalDateTime.now());
            var config = service.getParsedConfig();
            reportBuilder.getParsingTimeBuilder().end(LocalDateTime.now());
            var diagnostics = new Diagnostics();
            List<MappedStatementReport> reportList;
            DiagnosisReport diagnosisReport = diagnostics.execute(config).build();
            reportBuilder.diagnosisReport(diagnosisReport);
            reportList = diagnosisReport.getReportList();
            reportBuilder.getPrintingTimeBuilder().start(LocalDateTime.now());
            for(var report : reportList) {
                System.out.println(String.format("\uD83C\uDFAF %s", report.getMapperStatement().getId()));
                if (report.getPhase().ordinal() == 0) {
                    System.out.println(String.format("  ⌛ Any phase hasn't run."));
                }
                if (report.getPhase().ordinal() >= 1) {
                    System.out.println(String.format("  ⌛ the first phase (%s) has finished.", SyntaxError.class.getSimpleName()));
                }
                if (report.getPhase().ordinal() >= 2) {
                    System.out.println(String.format("  ⌛ the second phase (%s) has finished.", UnresolvedJavaTypeError.class.getSimpleName()));
                }
                if (report.getPhase().ordinal() >= 3) {
                    System.out.println(String.format("  ⌛ the third phase (%s) has finished.", ObjectNameNotFoundError.class.getSimpleName()));
                }
                if (report.getPhase().ordinal() >= 4) {
                    System.out.println(String.format("  ⌛ the fourth phase (%s) has finished.", IncompatibleTypeError.class.getSimpleName()));
                }
                System.out.println(String.format("  ✅ Diagnosis has finished."));
                if(report.getSyntaxErrorReport() != null){
                    for(var value : report.getSyntaxErrorReport().getErrorList()){
                        System.out.println(String.format("    🔨\uD83C\uDD82 %s", (lintOption.getPrintLevel() == LogLevel.Summary ? value.getSummary() : value.getDetails())));
                    }
                }
                if(report.getUnresolvedJavaTypeErrorReport() != null){
                    for(var value : report.getUnresolvedJavaTypeErrorReport().getErrorList()){
                        System.out.println(String.format("    🔨\uD83C\uDD84 %s", (lintOption.getPrintLevel() == LogLevel.Summary ? value.getSummary() : value.getDetails())));
                    }
                }
                if(report.getObjectNameNotFoundErrorReport() != null){
                    for(var value : report.getObjectNameNotFoundErrorReport().getErrorList()){
                        System.out.println(String.format("    🔨\uD83C\uDD7E %s", (lintOption.getPrintLevel() == LogLevel.Summary ? value.getSummary() : value.getDetails())));
                    }
                }
                if(report.getIncomptatibleTypeErrorReport() != null){
                    for(var value : report.getIncomptatibleTypeErrorReport().getErrorList()){
                        System.out.println(String.format("    🔨\uD83C\uDD78 %s", (lintOption.getPrintLevel() == LogLevel.Summary ? value.getSummary() : value.getDetails())));
                    }
                }
            }
            reportBuilder.getPrintingTimeBuilder().end(LocalDateTime.now());
        } catch (ConfigNotFoundException e) {
            e.printStackTrace();
        } catch (MyBatisProjectInitializationException e) {
            e.printStackTrace();
        }finally {
            reportBuilder.end(LocalDateTime.now());
        }
        return reportBuilder.build();
    }

Try With Resources try(var service=new MyBatisProjectService(lintOption.getProjectPath(),lintOption.getConfigFileName() != null ? lintOption.getConfigFileName() : "")) in method public lint(lintOption LintOption) : LintReport from class lint.cli.LintService


    private void addCoordinates(MatrixBuilder<Double> matrixBuilder, String line) {
        String[] coordinates = line.split(" ");
        Random random = new Random();
        double value;
        try {
            value = Double.parseDouble(coordinates[2]);
        } catch (ArrayIndexOutOfBoundsException e) {
            value = random.nextDouble();
        }

        matrixBuilder.set(new Coordinate<>(
                        Integer.parseInt(coordinates[0]) - 1,
                        Integer.parseInt(coordinates[1]) - 1,
                        value
                )
        );
    }

    private void addCoordinates(MatrixBuilder<Double> matrixBuilder, String line) {
        String[] coordinates = line.split(" ");
        Random random = new Random();
        double value;
        try {
            value = Double.parseDouble(coordinates[2]);
        } catch (ArrayIndexOutOfBoundsException e) {
            value = random.nextDouble();
        }

        matrixBuilder.set(new Coordinate<Double>(
                        Integer.parseInt(coordinates[0]),
                        Integer.parseInt(coordinates[1]),
                        value
                )
        );
    }

Replace Generic With Diamond Coordinate<Double> with Coordinate<> in method private addCoordinates(matrixBuilder MatrixBuilder<Double>, line String) : void from class software.ulpgc.bigdata.matrices.loaders.DoubleMatrixLoader


    private void addCoordinates(MatrixBuilder<Long> matrixBuilder, String line) {
        String[] coordinates = line.split(" ");
        Random random = new Random();
        long value;
        try {
            value = Long.parseLong(coordinates[2]);
        } catch (ArrayIndexOutOfBoundsException e) {
            value = random.nextLong();
        }

        matrixBuilder.set(new Coordinate<>(
                        Integer.parseInt(coordinates[0]) - 1,
                        Integer.parseInt(coordinates[1]) - 1,
                        value
                )
        );
    }

    private void addCoordinates(MatrixBuilder<Long> matrixBuilder, String line) {
        String[] coordinates = line.split(" ");
        Random random = new Random();
        long value;
        try {
            value = Long.parseLong(coordinates[2]);
        } catch (ArrayIndexOutOfBoundsException e) {
            value = random.nextLong();
        }

        matrixBuilder.set(new Coordinate<Long>(
                        Integer.parseInt(coordinates[0]),
                        Integer.parseInt(coordinates[1]),
                        value
                )
        );
    }

Replace Generic With Diamond Coordinate<Long> with Coordinate<> in method private addCoordinates(matrixBuilder MatrixBuilder<Long>, line String) : void from class software.ulpgc.bigdata.matrices.loaders.LongMatrixLoader


    public static List<AttackVector> getDirectionalActionPath(BaseMap combatMap, int dirmask, int x, int y, int minDistance, int maxDistance,
            boolean weaponCanAttackThroughObjects, boolean checkForCreatures, boolean isCannonBall) {

        List<AttackVector> path = new ArrayList<>();

        /*
         * try every tile in the given direction, up to the given range.
         * Stop when the the range is exceeded, or the action is blocked.
         */
        int nx = x;
        int ny = y;

        for (int distance = minDistance; distance <= maxDistance; distance++) {

            /* make sure our action isn't taking us off the map */
            if (nx > combatMap.getWidth() - 1 || nx < 0 || ny > combatMap.getHeight() - 1 || ny < 0) {
                break;
            }

            boolean blocked = combatMap.isTileBlockedForRangedAttack(nx, ny, checkForCreatures);

            Tile tile = combatMap.getTile(nx, ny);
            boolean canAttackOverSolid = (tile != null && tile.getRule() == TileRule.solid_attackover && weaponCanAttackThroughObjects);

            if (!blocked || canAttackOverSolid || isCannonBall) {
                path.add(new AttackVector(nx, ny));
            } else {
                path.add(new AttackVector(nx, ny));
                break;
            }

            if (Direction.isDirInMask(Direction.NORTH, dirmask)) {
                ny--;
            }
            if (Direction.isDirInMask(Direction.SOUTH, dirmask)) {
                ny++;
            }
            if (Direction.isDirInMask(Direction.EAST, dirmask)) {
                nx++;
            }
            if (Direction.isDirInMask(Direction.WEST, dirmask)) {
                nx--;
            }

        }

        return path;
    }

    public static List<AttackVector> getDirectionalActionPath(BaseMap combatMap, int dirmask, int x, int y, int minDistance, int maxDistance,
            boolean weaponCanAttackThroughObjects, boolean checkForCreatures, boolean isCannonBall) {

        List<AttackVector> path = new ArrayList<AttackVector>();

        /*
         * try every tile in the given direction, up to the given range.
         * Stop when the the range is exceeded, or the action is blocked.
         */
        int nx = x;
        int ny = y;

        for (int distance = minDistance; distance <= maxDistance; distance++) {

            /* make sure our action isn't taking us off the map */
            if (nx > combatMap.getWidth() - 1 || nx < 0 || ny > combatMap.getHeight() - 1 || ny < 0) {
                break;
            }

            boolean blocked = combatMap.isTileBlockedForRangedAttack(nx, ny, checkForCreatures);

            Tile tile = combatMap.getTile(nx, ny);
            boolean canAttackOverSolid = (tile != null && tile.getRule() == TileRule.solid_attackover && weaponCanAttackThroughObjects);

            if (!blocked || canAttackOverSolid || isCannonBall) {
                path.add(new AttackVector(nx, ny));
            } else {
                path.add(new AttackVector(nx, ny));
                break;
            }

            if (Direction.isDirInMask(Direction.NORTH, dirmask)) {
                ny--;
            }
            if (Direction.isDirInMask(Direction.SOUTH, dirmask)) {
                ny++;
            }
            if (Direction.isDirInMask(Direction.EAST, dirmask)) {
                nx++;
            }
            if (Direction.isDirInMask(Direction.WEST, dirmask)) {
                nx--;
            }

        }

        return path;
    }

Replace Generic With Diamond ArrayList<AttackVector> with ArrayList<> in method public getDirectionalActionPath(combatMap BaseMap, dirmask int, x int, y int, minDistance int, maxDistance int, weaponCanAttackThroughObjects boolean, checkForCreatures boolean, isCannonBall boolean) : List<AttackVector> from class util.Utils


    private void newPage() {
        Page page = new Page();
        page.image = new Pixmap(pageWidth, pageHeight, pageFormat);
        page.root = new Node(0, 0, pageWidth, pageHeight, null, null, null);
        page.rects = new OrderedMap<>();
        pages.add(page);
        currPage = page;
    }

    private void newPage() {
        Page page = new Page();
        page.image = new Pixmap(pageWidth, pageHeight, pageFormat);
        page.root = new Node(0, 0, pageWidth, pageHeight, null, null, null);
        page.rects = new OrderedMap<String, Rectangle>();
        pages.add(page);
        currPage = page;
    }

Replace Generic With Diamond OrderedMap<String,Rectangle> with OrderedMap<> in method private newPage() : void from class bioware.AnimationPixMapPacker


    public Animation getAnimation(String name) {
        List<TextureRegion> texts = animations.get(name);
        Animation anim = new Animation(.125f, new Array<>((TextureRegion[]) texts.toArray()));
        return anim;
    }

    public Animation getAnimation(String name) {
        List<TextureRegion> texts = animations.get(name);
        Animation anim = new Animation(.125f, new Array<TextureRegion>((TextureRegion[]) texts.toArray()));
        return anim;
    }

Replace Generic With Diamond Animation with Animation in method public getAnimation(name String) : Animation from class bioware.BamAnimationStore


    public List<Portal> getPortals(int x, int y, int z) {
        List<Portal> ps = new ArrayList<>();
        if (portals == null) {
            return ps;
        }
        for (Portal p : portals) {
            if (p.getX() == x && p.getY() == y && p.getZ() == z) {
                ps.add(p);
            }
        }
        return ps;
    }

    public List<Portal> getPortals(int x, int y, int z) {
        List<Portal> ps = new ArrayList<Portal>();
        if (portals == null) {
            return ps;
        }
        for (Portal p : portals) {
            if (p.getX() == x && p.getY() == y && p.getZ() == z) {
                ps.add(p);
            }
        }
        return ps;
    }

Replace Generic With Diamond ArrayList<Portal> with ArrayList<> in method public getPortals(x int, y int, z int) : List<Portal> from class objects.BaseMap


	public void registerButton(TextureButton button)
	{
		if (guiButtons == null) guiButtons = new ArrayList<>();
		guiButtons.add(button);
	}

	public void registerButton(TextureButton button)
	{
		if (guiButtons == null) guiButtons = new ArrayList<TextureButton>();
		guiButtons.add(button);
	}

Replace Generic With Diamond ArrayList<TextureButton> with ArrayList<> in method public registerButton(button TextureButton) : void from class com.github.hydos.ginger.engine.api.GingerRegister


	public void registerText(GUIText guiText)
	{
		if (texts == null) texts = new ArrayList<>();
		texts.add(guiText);
	}

	public void registerText(GUIText guiText)
	{
		if (texts == null) texts = new ArrayList<GUIText>();
		texts.add(guiText);
	}

Replace Generic With Diamond ArrayList<GUIText> with ArrayList<> in method public registerText(guiText GUIText) : void from class com.github.hydos.ginger.engine.api.GingerRegister


	public GingerThreading()
	{ worldChunkThreadWaitlist = new ArrayList<>(); }

	public GingerThreading()
	{ worldChunkThreadWaitlist = new ArrayList<GingerThread>(); }

Replace Generic With Diamond ArrayList<GingerThread> with ArrayList<> in method public GingerThreading() from class com.github.hydos.multithreading.GingerThreading


	public Chunk(int chunkX, int chunkY, int chunkZ, int dimension)
	{
		renderList = new ArrayList<>();
		this.chunkX = chunkX;
		this.chunkY = chunkY;
		this.chunkZ = chunkZ;
		this.chunkStartX = chunkX << POS_SHIFT;
		this.chunkStartY = chunkY << POS_SHIFT;
		this.chunkStartZ = chunkZ << POS_SHIFT;
		this.dimension = dimension;
	}

	public Chunk(int chunkX, int chunkY, int chunkZ, int dimension)
	{
		renderList = new ArrayList<BlockEntity>();
		this.chunkX = chunkX;
		this.chunkY = chunkY;
		this.chunkZ = chunkZ;
		this.chunkStartX = chunkX << POS_SHIFT;
		this.chunkStartY = chunkY << POS_SHIFT;
		this.chunkStartZ = chunkZ << POS_SHIFT;
		this.dimension = dimension;
	}

Replace Generic With Diamond ArrayList<BlockEntity> with ArrayList<> in method public Chunk(chunkX int, chunkY int, chunkZ int, dimension int) from class com.github.halotroop.litecraft.world.Chunk


    public TrackerSQL() {
        try (InputStream in = TrackerSQL.class.getClassLoader().getResourceAsStream("app.properties")) {
            Properties config = new Properties();
            config.load(in);
            Class.forName(config.getProperty("driver-class-name"));
            this.connection = DriverManager.getConnection(
                    config.getProperty("url"),
                    config.getProperty("username"),
                    config.getProperty("password")
            );
        } catch (Exception e) {
            throw new IllegalStateException(e);
        }

        try (Statement st = this.connection.createStatement()) {
            st.execute("create table if not exists item(id serial primary key, name varchar(200));");
            st.execute("delete from item;");
        } catch (Exception e) {
            LOG.error(e.getMessage(), e);
        }
    }

    public TrackerSQL() {
        try (InputStream in = TrackerSQL.class.getClassLoader().getResourceAsStream("app.properties")) {
            Properties config = new Properties();
            config.load(in);
            Class.forName(config.getProperty("driver-class-name"));
            this.connection = DriverManager.getConnection(
                    config.getProperty("url"),
                    config.getProperty("username"),
                    config.getProperty("password")
            );
        } catch (Exception e) {
            throw new IllegalStateException(e);
        }

        try {
            Statement st = this.connection.createStatement();
            st.execute("create table if not exists item(id serial primary key, name varchar(200));");
            st.execute("delete from item;");
        } catch (Exception e) {
            LOG.error(e.getMessage(), e);
        }
    }

Try With Resources try(Statement st=this.connection.createStatement()) in method public TrackerSQL() from class ru.job4j.tracker.TrackerSQL


    @Override
    public Item add(Item item) {
        try (PreparedStatement st = connection
                .prepareStatement("insert into item(name) values(?)", Statement.RETURN_GENERATED_KEYS)) {
            st.setString(1, item.getName());
            st.executeUpdate();
            try (ResultSet generatedKeys = st.getGeneratedKeys()) {
                if (generatedKeys.next()) {
                    item.setId(String.valueOf(generatedKeys.getInt(1)));
                }
            }
        } catch (Exception e) {
            LOG.error(e.getMessage(), e);
        }

        return item;
    }

    @Override
    public Item add(Item item) {
        try {
            PreparedStatement st = connection.prepareStatement("insert into item(name) values(?)", Statement.RETURN_GENERATED_KEYS);
            st.setString(1, item.getName());
            st.executeUpdate();
            ResultSet generatedKeys = st.getGeneratedKeys();
            if (generatedKeys.next()) {
                item.setId(String.valueOf(generatedKeys.getInt(1)));
            }
        } catch (Exception e) {
            LOG.error(e.getMessage(), e);
        }

        return item;
    }

Try With Resources try(ResultSet generatedKeys=st.getGeneratedKeys()) in method public add(item Item) : Item from class ru.job4j.tracker.TrackerSQL


    @Override
    public boolean replace(String id, Item item) {
        boolean result = false;
        try (PreparedStatement st = connection
                .prepareStatement("update item set name = (?) where id = (?)")) {
            st.setString(1, item.getName());
            st.setInt(2, Integer.parseInt(id));
            if (st.executeUpdate() > 0) {
                result = true;
            }
        } catch (Exception e) {
            LOG.error(e.getMessage(), e);
        }

        return result;
    }

    @Override
    public boolean replace(String id, Item item) {
        boolean result = false;
        try {
            PreparedStatement st = connection.prepareStatement("update item set name = (?) where id = (?)");
            st.setString(1, item.getName());
            st.setInt(2, Integer.parseInt(id));
            if (st.executeUpdate() > 0) {
                result = true;
            }
        } catch (Exception e) {
            LOG.error(e.getMessage(), e);
        }

        return result;
    }

Try With Resources try(PreparedStatement st=connection.prepareStatement("update item set name = (?) where id = (?)")) in method public replace(id String, item Item) : boolean from class ru.job4j.tracker.TrackerSQL


    @Override
    public boolean delete(String id) {
        boolean result = false;
        try (PreparedStatement st = connection
                .prepareStatement("delete from item where id = (?)")) {
            st.setInt(1, Integer.parseInt(id));
            if (st.executeUpdate() > 0) {
                result = true;
            }
        } catch (Exception e) {
            LOG.error(e.getMessage(), e);
        }

        return result;
    }

    @Override
    public boolean delete(String id) {
        boolean result = false;
        try {
            PreparedStatement st = connection.prepareStatement("delete from item where id = (?)");
            st.setInt(1, Integer.parseInt(id));
            if (st.executeUpdate() > 0) {
                result = true;
            }
        } catch (Exception e) {
            LOG.error(e.getMessage(), e);
        }

        return result;
    }

Try With Resources try(PreparedStatement st=connection.prepareStatement("delete from item where id = (?)")) in method public delete(id String) : boolean from class ru.job4j.tracker.TrackerSQL


    @Override
    public List<Item> findAll() {
        List<Item> list = new ArrayList<Item>();
        try (Statement st = connection.createStatement();
             ResultSet rs = st.executeQuery("select * from item")) {
            while (rs.next()) {
                Item item = new Item(rs.getString("name"));
                item.setId(rs.getString("id"));
                list.add(item);
            }
        } catch (Exception e) {
            LOG.error(e.getMessage(), e);
        }

        return list;
    }

    @Override
    public List<Item> findAll() {
        List<Item> list = new ArrayList<Item>();
        try {
            Statement st = connection.createStatement();
            ResultSet rs = st.executeQuery("select * from item");
            while (rs.next()) {
                Item item = new Item(rs.getString("name"));
                item.setId(rs.getString("id"));
                list.add(item);
            }
        } catch (Exception e) {
            LOG.error(e.getMessage(), e);
        }

        return list;
    }

Try With Resources try(Statement st=connection.createStatement(); ResultSet rs=st.executeQuery("select * from item")) in method public findAll() : List<Item> from class ru.job4j.tracker.TrackerSQL


    @Override
    public List<Item> findByName(String key) {
        List<Item> list = new ArrayList<Item>();
        try (PreparedStatement st = connection
                .prepareStatement("select * from item where name = (?)")) {
            st.setString(1, key);
            try (ResultSet rs = st.executeQuery()) {
                while (rs.next()) {
                    Item item = new Item(rs.getString("name"));
                    item.setId(rs.getString("id"));
                    list.add(item);
                }
            }
        } catch (Exception e) {
            LOG.error(e.getMessage(), e);
        }

        return list;
    }

    @Override
    public List<Item> findByName(String key) {
        List<Item> list = new ArrayList<Item>();
        try {
            PreparedStatement st = connection.prepareStatement("select * from item where name = (?)");
            st.setString(1, key);
            ResultSet rs = st.executeQuery();
            while (rs.next()) {
                Item item = new Item(rs.getString("name"));
                item.setId(rs.getString("id"));
                list.add(item);
            }
        } catch (Exception e) {
            LOG.error(e.getMessage(), e);
        }

        return list;
    }

Try With Resources try(ResultSet rs=st.executeQuery()) in method public findByName(key String) : List<Item> from class ru.job4j.tracker.TrackerSQL


    @Override
    public Item findById(String id) {
        Item item = null;
        try (PreparedStatement st = connection
                .prepareStatement("select * from item where id = (?)")) {
            st.setInt(1, Integer.parseInt(id));
            try (ResultSet rs = st.executeQuery()) {
                if (rs.next()) {
                    item = new Item(rs.getString("name"));
                    item.setId(id);
                }
            }
        } catch (Exception e) {
            LOG.error(e.getMessage(), e);
        }

        return item;
    }

    @Override
    public Item findById(String id) {
        Item item = null;
        try {
            PreparedStatement st = connection.prepareStatement("select * from item where id = (?)");
            st.setInt(1, Integer.parseInt(id));
            ResultSet rs = st.executeQuery();
            if (rs.next()) {
                item = new Item(rs.getString("name"));
                item.setId(id);
            }
        } catch (Exception e) {
            LOG.error(e.getMessage(), e);
        }

        return item;
    }

Try With Resources try(ResultSet rs=st.executeQuery()) in method public findById(id String) : Item from class ru.job4j.tracker.TrackerSQL


    private void startOilTransfers(int frequency, int minAmount, int maxAmount) {
        logger.info("Starting automated oil transfers");
        executor.scheduleAtFixedRate(() -> {
            synchronized (directConnectionsLock) {
                if (directConnections.size() > 0) {
                    try {
                        ConnectionDetails randomWell = directConnections.get((int) (Math.random() * (directConnections.size())));
                        int amount = minAmount + (int) (Math.random() * ((maxAmount - minAmount) + 1));
                        synchronized (oilAmountLock) {
                            if (oilAmount - amount >= 0) {
                                logger.info("Sending " + amount + " oil to " + randomWell.getHostname() + ":" + randomWell.getPort() + ". New oilAmount = " + oilAmount);
                                distributedSnapshot.sendMessage(randomWell.getHostname(), randomWell.getPort(), new OilCargo(amount));
                                oilAmount -= amount;
                            } else {
                                logger.warn("You are running out of oil, cannot send oil to " + randomWell.getHostname() + ":" + randomWell.getPort());
                            }
                        }
                    } catch (RemoteNodeNotFound | RemoteException e) {
                        logger.warn("Error sending oil cargo");
                    } catch (NotBoundException | SnapshotInterruptException e) {
                        e.printStackTrace();
                    }
                }
            }
        }, 0, frequency, TimeUnit.MILLISECONDS);
    }

    private void startOilTransfers(int frequency, int minAmount, int maxAmount) {
        logger.info("Starting automated oil transfers");
        executor.scheduleAtFixedRate(() -> {
            synchronized (directConnectionsLock) {
                if (directConnections.size() > 0) {
                    try {
                        ConnectionDetails randomWell = directConnections.get((int) (Math.random() * (directConnections.size())));
                        int amount = minAmount + (int) (Math.random() * ((maxAmount - minAmount) + 1));
                        synchronized (oilAmountLock) {
                            if (oilAmount - amount >= 0) {
                                logger.info("Sending " + amount + " oil to " + randomWell.getHostname() + ":" + randomWell.getPort() + ". New oilAmount = " + oilAmount);
                                distributedSnapshot.sendMessage(randomWell.getHostname(), randomWell.getPort(), new OilCargo(amount));
                                oilAmount -= amount;
                            } else {
                                logger.warn("You are running out of oil, cannot send oil to " + randomWell.getHostname() + ":" + randomWell.getPort());
                            }
                        }
                    } catch (RemoteNodeNotFound | RemoteException e) {
                        logger.warn("Error sending oil cargo");
                    } catch (NotBoundException e) {
                        e.printStackTrace();
                    } catch (SnapshotInterruptException e) {
                        e.printStackTrace();
                    }
                }
            }
        }, 0, frequency, TimeUnit.MILLISECONDS);
    }

Merge Catch [catch(NotBoundException e), catch(SnapshotInterruptException e)] to catch(NotBoundException|SnapshotInterruptException e) in method private startOilTransfers(frequency int, minAmount int, maxAmount int) : void from class oilwells.OilWell


	public List<AbstractFile> getChildren() {
		return getChildFiles(f -> true);
	}

	public List<AbstractFile> getChildren() {
		return getChildFiles(new FileFilter() {

			@Override
			public boolean accept(AbstractFile f) {
				return true;
			}
		});
	}

Replace Anonymous With Lambda toools.io.file.Directory.getChildren.getChildFiles.new FileFilter with f -> true in method public getChildren() : List<AbstractFile> from class toools.io.file.Directory


	public LongProcess(String object, String unit, double target,
			Consumer<String> stdout) {
		this.msgOut = stdout;
		if (object != null) {
			stdout("> STARTING " + object);
		}

		stack.push(this);

		// if (unit == null)
		// throw new NullPointerException("it makes no sense to set unit to
		// null. Please give it a name.");

		this.unit = unit;
		this.object = object;
		this.target = target;

		this.thread = new Thread(() -> {
			// initial sleep
			Threads.sleepMs(refreshInterval);

			while (true) {
				Threads.sleepMs(refreshInterval);
				double progressStatus = sensor.getProgress();
				progressHistory.add(new State(progressStatus));

				if (progressStatus < 0 || (target != - 1 && progressStatus >= target))
					break;

				if (stack.peek() == LongProcess.this && progressStatus > 0) {
					String msg = getMessage();
					stdout.accept(msg);

					if (file != null) {
						file.setContent(msg.getBytes());
					}

					++progressPrintCount;
				}
			}

			stack.remove(LongProcess.this);
		});

		thread.setDaemon(true);
		thread.setPriority(Thread.MAX_PRIORITY);
		thread.start();
	}

	public LongProcess(String object, String unit, double target)
	{
		stack.push(this);
		Cout.leftShit++;

		//if (unit == null)
		//	throw new NullPointerException("it makes no sense to set unit to null. Please give it a name.");

		this.unit = unit;
		this.object = object;
		this.target = target;

		if (object != null)
			Cout.progress("> STARTING " + object);

		Thread t = new Thread(new Runnable()
		{
			@Override
			public void run()
			{
				// initial sleep
				Threads.sleepMs(refreshInterval);

				while (true)
				{
					Threads.sleepMs(refreshInterval);
					double progressStatus = sensor.getProgress();
					progressHistory.add(new State(progressStatus));

					if (progressStatus < 0 || (target != - 1 && progressStatus >= target))
						break;

					if (stack.peek() == LongProcess.this && progressStatus > 0)
					{
						String msg = getMessage();
						Cout.progress(msg);

						if (file != null)
						{
							file.setContent(msg.getBytes());
						}

						++progressPrintCount;
					}
				}

				stack.remove(LongProcess.this);
			}
		});

		t.setDaemon(true);
		t.setPriority(Thread.MAX_PRIORITY);
		t.start();
	}

Replace Anonymous With Lambda toools.progression.LongProcess.LongProcess.t.new Thread.new Runnable with () -> {Threads.sleepMs(refreshInterval); in method public LongProcess(object String, unit String, target double, stdout Consumer<String>) from class toools.progression.LongProcess


	public RegionData parse(Path mcaFile)
	{
		RegionData region = null;
		try(InputStream rawData = new BufferedInputStream(Files.newInputStream(mcaFile)))
		{
			String   filename = mcaFile.getFileName().toString();
			String[] tokens   = filename.split("[.]");
			if(tokens.length == 4 && tokens[0].equals("r") && tokens[3].equals("mca"))
			{
				int regionX = Integer.valueOf(tokens[1]);
				int regionZ = Integer.valueOf(tokens[2]);
				region = parse(regionX, regionZ, rawData);
			}
			else
			{
				System.err.println("unknown format of the MCA filename <" + filename + ">, region not parsed");
			}
		}
		catch(IOException e)
		{
			System.err.println("error opening MCA file: " + mcaFile);
			e.printStackTrace();
		}

		return region;
	}

	public RegionData parse(File mcaFile)
	{
		RegionData region = null;
		try
		{
			InputStream input    = new FileInputStream(mcaFile);
			String      filename = mcaFile.getName();

			String[] tokens = filename.split("[.]");
			if(tokens.length == 4 && tokens[0].equals("r") && tokens[3].equals("mca"))
			{
				int regionX = Integer.valueOf(tokens[1]);
				int regionZ = Integer.valueOf(tokens[2]);
				region = parse(regionX, regionZ, input);
			}
			else
			{
				System.err.println("unknown format of the MCA filename <" + filename + ">, region not parsed");
			}
		}
		catch(FileNotFoundException e)
		{
			System.err.println("error opening MCA file: " + mcaFile);
			e.printStackTrace();
		}

		return region;
	}

Try With Resources try(InputStream rawData=new BufferedInputStream(Files.newInputStream(mcaFile))) in method public parse(mcaFile Path) : RegionData from class minecraft.parser.MCAParser


    @Test
    public void testArrayManipulation() {

        try (var scanner = new Scanner(Objects.requireNonNull(getClass().getClassLoader().getResourceAsStream("array_manipulation_test_case.txt")))) {
            String[] nm = scanner.nextLine().split(" ");

            int n = Integer.parseInt(nm[0]);

            int m = Integer.parseInt(nm[1]);

            int[][] queries = new int[m][3];

            for (int i = 0; i < m; i++) {
                String[] queriesRowItems = scanner.nextLine().split(" ");
                scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");

                for (int j = 0; j < 3; j++) {
                    int queriesItem = Integer.parseInt(queriesRowItems[j]);
                    queries[i][j] = queriesItem;
                }
            }

            assertEquals(2497169732L, ArrayManipulation.arrayManipulation(n, queries));
        }
    }

    @Test
    public void testArrayManipulation() {

        var scanner = new Scanner(getClass().getClassLoader().getResourceAsStream("array_manipulation_test_case.txt"));

        try {
            String[] nm = scanner.nextLine().split(" ");

            int n = Integer.parseInt(nm[0]);

            int m = Integer.parseInt(nm[1]);

            int[][] queries = new int[m][3];

            for (int i = 0; i < m; i++) {
                String[] queriesRowItems = scanner.nextLine().split(" ");
                scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");

                for (int j = 0; j < 3; j++) {
                    int queriesItem = Integer.parseInt(queriesRowItems[j]);
                    queries[i][j] = queriesItem;
                }
            }

            assertEquals(2497169732L, ArrayManipulation.arrayManipulation(n, queries));
        } finally {
            scanner.close();
        }
    }

Try With Resources try(var scanner=new Scanner(Objects.requireNonNull(getClass().getClassLoader().getResourceAsStream("array_manipulation_test_case.txt")))) in method public testArrayManipulation() : void from class com.github.gabrielbb.practicing.PracticingTests


	public void loadMap(File mapFile) {//String map) {
		String linea;
		String nums[] = null;

		int col = 0;
		int row = 0;

		try (BufferedReader reader = new BufferedReader(new FileReader(mapFile))) {
			while(col < GameVariables.MAX_WORLD_COL && row < GameVariables.MAX_WORLD_ROW) {
				linea = reader.readLine();
				while(col < GameVariables.MAX_WORLD_COL) {
					nums = linea.split(" ");
					mapNum[col][row] = Integer.parseInt(nums[col]);
					col++;
				}
				if(col == GameVariables.MAX_WORLD_COL) {
					col = 0;
					row++;
				}

			}
		} catch(IOException ex) {
			ex.printStackTrace();
		}
	}

	public void loadMap(String map) {

		try {
			InputStream is = getClass().getResourceAsStream(map);
			BufferedReader br = new BufferedReader(new InputStreamReader(is));
			String linea;
			String[] nums = null;

			int col = 0;
			int row = 0;

			while(col < GameVariables.MAX_WORLD_COL && row < GameVariables.MAX_WORLD_ROW) {
				linea = br.readLine();
				while(col < GameVariables.MAX_WORLD_COL) {
					nums = linea.split(" ");
					mapNum[col][row] = Integer.parseInt(nums[col]);
					col++;
				}
				if(col == GameVariables.MAX_WORLD_COL) {
					col = 0;
					row++;
				}
			}
		} catch(IOException e) {
			e.printStackTrace();
		}

	}

Try With Resources try(BufferedReader reader=new BufferedReader(new FileReader(mapFile))) in method public loadMap(mapFile File) : void from class engine.tiles.TileHandler


/**
     * Loads a network, which is given in file. Can only read
     * networks, which had been saved by a simple
     * ObjectOutputStream. The order of saved objects (and its
     * corresponding type) is: vertices (HashMap<Integer, Vertex>
     * flows (HashMap<Integer, Flow>) hoelders (HashMap<Integer, Hoelder>)
     *
     * @param profile_path
     * @param redirectListeners
     * @return
     */
    public static Network load(File profile_path, boolean redirectListeners) {
        //will read profile.txt line by line
        Network nw = new Network();
        // Kind of a hack
        if (redirectListeners) {
            List<NetworkListener> oldListeners = SNC.getInstance().getCurrentNetwork().getListeners();
            for (NetworkListener l : oldListeners) {
                l.clear();
                nw.addListener(l);
            }
        }
        try (BufferedReader br = new BufferedReader(new FileReader(profile_path))) {
            String sCurrentLine;

            //reads all lines
            while ((sCurrentLine = br.readLine()) != null) {
                //if a line starts with "I" an interface (i.e. service element) is added to the network in form of a Vertex.
                if (sCurrentLine.startsWith("I")) {
                    try {
                        nw.handleVertexLine(sCurrentLine);
                    } catch (BadInitializationException | NumberFormatException e) {
                        nw.clearListeners(redirectListeners);
                        //"Parameter for constant rate server must be a non-negative number."
                        throw new FileOperationException(e.getMessage(), sCurrentLine);
                    }
                }

                //if a line starts with "F" a flow is added to the network in form of a Flow-object.
                if (sCurrentLine.startsWith("F")) {
                    try {
                        nw.handleFlowLine(sCurrentLine);
                    } catch (BadInitializationException | ArrivalNotAvailableException | FileOperationException e) {
                        nw.clearListeners(redirectListeners);
                        throw new FileOperationException(e.getMessage(), sCurrentLine);
                    }
                }
            }
            System.out.println("The following vertices had been added (alias, rate):");
            for (Vertex vertex : nw.getVertices().values()) {
                System.out.println(vertex.getAlias() + ", " + vertex.getService().toString());
            }
            System.out.println("The following flows had been added (alias, route, priorities):");
            for (Flow flow : nw.getFlows().values()) {
                System.out.println(flow.getAlias() + ", " + flow.getVerticeIDs() + ", " + flow.getPriorities());
            }
            br.close();
        } catch (IOException e) {
            // Will be automatically closed due to try-with-resources
            // Rewrap the exception and propagate it upwards
            throw new FileOperationException(e);
        }
        return nw;
    }

/**
     * Loads a network, which is given in file. Can only read
     * networks, which had been saved by a simple
     * ObjectOutputStream. The order of saved objects (and its
     * corresponding type) is: vertices (HashMap<Integer, Vertex>
     * flows (HashMap<Integer, Flow>) hoelders (HashMap<Integer, Hoelder>)
     *
     * @param profile_path
     * @return
     */
    public static Network load(File profile_path, boolean redirectListeners) {
        //will read profile.txt line by line
        BufferedReader br = null;
        Network nw = new Network();
        // Kind of a hack
        if (redirectListeners) {
            List<NetworkListener> oldListeners = SNC.getInstance().getCurrentNetwork().getListeners();
            for (NetworkListener l : oldListeners) {
                l.clear();
                nw.addListener(l);
            }
        }
        try {
            String sCurrentLine;
            br = new BufferedReader(new FileReader(profile_path));

            //reads all lines
            while ((sCurrentLine = br.readLine()) != null) {
                //if a line starts with "I" an interface (i.e. service element) is added to the network in form of a Vertex.
                if (sCurrentLine.startsWith("I")) {
                    try {
                        nw.handleVertexLine(sCurrentLine);
                    } catch (BadInitializationException | NumberFormatException e) {
                        System.out.println("Bad Initialization in line " + sCurrentLine + ". Parameter for Constant Rate server must be a non-negative number.");
                        e.printStackTrace();
                    }
                }

                //if a line starts with "F" a flow is added to the network in form of a Flow-object.
                if (sCurrentLine.startsWith("F")) {
                    try {
                        nw.handleFlowLine(sCurrentLine);
                    } catch (NumberFormatException | BadInitializationException | ArrivalNotAvailableException e) {
                        System.out.println("Error at line " + sCurrentLine + ":");
                        e.printStackTrace();
                    }
                }
            }
            System.out.println("The following vertices had been added (alias, rate):");
            for (Vertex vertex : nw.getVertices().values()) {
                System.out.println(vertex.getAlias() + ", " + vertex.getService().toString());
            }
            System.out.println("The following flows had been added (alias, route, priorities):");
            for (Flow flow : nw.getFlows().values()) {
                System.out.println(flow.getAlias() + ", " + flow.getVerticeIDs() + ", " + flow.getPriorities());
            }
            br.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return nw;
    }

Try With Resources try(BufferedReader br=new BufferedReader(new FileReader(profile_path))) in method public load(profile_path File, redirectListeners boolean) : Network from class unikl.disco.calculator.network.Network


    /**
     * Creates a new flow with an initial arrival and a complete description of
     * its route through the network (in expression all of its vertices and the
     * corresponding priorities at these vertices of the flow).
     *
     * @param initial_arrival the arrival at the first node
     * @param route
     * @param vertices the vertices the flow traverses
     * @param priorities the priorities of the flow at the corresponding
     * vertices
     * @param alias the alias of the new flow
     * @return
     * @throws ArrivalNotAvailableException
     */
    public int addFlow(Arrival initial_arrival, List<Integer> route, List<Integer> priorities,
            String alias) throws ArrivalNotAvailableException {

        // Creates the dummy arrivals for all vertices after the first
        List<Arrival> arrivals = new ArrayList<>(1);
        arrivals.add(0, initial_arrival);
        for (int i = 1; i < route.size(); i++) {
            arrivals.add(new Arrival(this));
        }

        //Adds the flow into the flow list
        Flow flow = new Flow(FLOW_ID, route, arrivals, priorities, alias, this);
        flows.put(FLOW_ID, flow);

        //Writes the flow in its corresponding vertices
        for (int i = 0; i < route.size(); i++) {
            Vertex vertex;
            vertex = vertices.get(route.get(i));
            vertex.addUnknownArrival(priorities.get(i), FLOW_ID);
        }

        Vertex first_vertex = vertices.get(route.get(0));

        //Initializes the first arrival at the first vertex
        first_vertex.learnArrival(FLOW_ID, initial_arrival);

        //Increments the flow count
        incrementFLOW_ID();

        // Notify the listeners
        for (NetworkListener l : listeners) {
            l.flowAdded(flow);
        }
        return flow.getID();
    }

    /**
     * Creates a new flow with an initial arrival and a complete description of
     * its route through the network (in expression all of its vertices and the
     * corresponding priorities at these vertices of the flow).
     *
     * @param initial_arrival the arrival at the first node
     * @param route
     * @param vertices the vertices the flow traverses
     * @param priorities the priorities of the flow at the corresponding
     * vertices
     * @param alias the alias of the new flow
     * @return
     * @throws ArrivalNotAvailableException
     */
    public int addFlow(Arrival initial_arrival, List<Integer> route, List<Integer> priorities,
            String alias) throws ArrivalNotAvailableException {

        // Creates the dummy arrivals for all vertices after the first
        List<Arrival> arrivals = new ArrayList<Arrival>(1);
        arrivals.add(0, initial_arrival);
        for (int i = 1; i < route.size(); i++) {
            arrivals.add(new Arrival(this));
        }

        //Adds the flow into the flow list
        Flow flow = new Flow(FLOW_ID, route, arrivals, priorities, alias, this);
        flows.put(FLOW_ID, flow);

        //Writes the flow in its corresponding vertices
        for (int i = 0; i < route.size(); i++) {
            Vertex vertex;
            vertex = vertices.get(route.get(i));
            vertex.addUnknownArrival(priorities.get(i), FLOW_ID);
        }

        Vertex first_vertex = vertices.get(route.get(0));

        //Initializes the first arrival at the first vertex
        first_vertex.learnArrival(FLOW_ID, initial_arrival);

        //Increments the flow count
        incrementFLOW_ID();

        // Notify the listeners
        for (NetworkListener l : listeners) {
            l.flowAdded(flow);
        }
        return flow.getID();
    }

Replace Generic With Diamond ArrayList<Arrival> with ArrayList<> in method public addFlow(initial_arrival Arrival, route List<Integer>, priorities List<Integer>, alias String) : int from class unikl.disco.calculator.network.Network


	@Override
	public double Bound(Arrival input, Boundtype boundtype, double bound, double thetagranularity, double hoeldergranularity)
			throws ThetaOutOfBoundException, ParameterMismatchException, ServerOverloadException {

		double result;

		//Initializes the list of Hoelder-Parameters...
		Map<Integer, Hoelder> allparameters = new HashMap<>(0);
		allparameters.putAll(input.getSigma().getParameters());
		allparameters.putAll(input.getRho().getParameters());

		//If needed, the parameter, which represents the backlog, must be separated from the other Hoelder parameters
		if(boundtype == AbstractAnalysis.Boundtype.BACKLOG){
                    allparameters.get(allparameters.size()).setPValue(bound);
                    allparameters.remove(allparameters.size());
		}
		for(Map.Entry<Integer, Hoelder> entry : allparameters.entrySet()){
			entry.getValue().setPValue(2);
		}

		//Initializes theta
		double max_theta = input.getThetastar();
		double sigmapart;
		double rhopart;
		double theta = thetagranularity;
		int changed_hoelder = Integer.MAX_VALUE;
		boolean improved = true;

		Change change = SimpleGradient.Change.NOTHING;

		switch(boundtype){
			case BACKLOG:

				//Computes initial value
				double backlogprob;
				double new_backlogprob;
				try{
					backlogprob = input.evaluate(theta, 0, 0);
				}
				catch(ServerOverloadException e){
					backlogprob = Double.POSITIVE_INFINITY;
				}
				while(improved){
					improved = false;
					change = SimpleGradient.Change.NOTHING;
					//Check if decreasing theta leads to a better result
					if(theta > thetagranularity){

						theta = theta - thetagranularity;
						try{
							new_backlogprob = input.evaluate(theta, 0, 0);
						}
						catch(ServerOverloadException e){
							new_backlogprob = Double.POSITIVE_INFINITY;
						}
						catch(ThetaOutOfBoundException e){
							new_backlogprob = Double.POSITIVE_INFINITY;
						}
						if(backlogprob > new_backlogprob){
							backlogprob = new_backlogprob;
							change = SimpleGradient.Change.THETA_DEC;
						}

						theta = theta + thetagranularity;
					}

					//Check if increasing theta leads to a better result
					if(theta < max_theta - thetagranularity){
						theta = theta + thetagranularity;
						try{
							new_backlogprob = input.evaluate(theta, 0 , 0);
						}
						catch(ServerOverloadException e){
							new_backlogprob = Double.POSITIVE_INFINITY;
						}
						catch(ThetaOutOfBoundException e){
							new_backlogprob = Double.POSITIVE_INFINITY;
						}
						if(backlogprob > new_backlogprob){
							backlogprob = new_backlogprob;
							change = SimpleGradient.Change.THETA_INC;
						}

						theta = theta - thetagranularity;
					}

					//Check each neighbors resulting from decreasing the P-Value of Hoelder parameters
					for(Map.Entry<Integer, Hoelder> entry : allparameters.entrySet()){
						double old_p_value = entry.getValue().getPValue();
						if(entry.getValue().getPValue() < 2){
							entry.getValue().setPValue(-hoeldergranularity + entry.getValue().getPValue());
						}
						else{
							entry.getValue().setQValue(hoeldergranularity + entry.getValue().getQValue());
						}
						try{
							new_backlogprob = input.evaluate(theta, 0, 0);
						}
						catch(ServerOverloadException e){
							new_backlogprob = Double.POSITIVE_INFINITY;
						}
						catch(ThetaOutOfBoundException e){
							new_backlogprob = Double.POSITIVE_INFINITY;
						}
						if(backlogprob > new_backlogprob){
							backlogprob = new_backlogprob;
							changed_hoelder = entry.getKey();
							change = SimpleGradient.Change.HOELDER_P;
						}

						entry.getValue().setPValue(old_p_value);
					}

					//Check each neighbor by decreasing the Q-Value of Hoelder parameters
					for(Map.Entry<Integer, Hoelder> entry : allparameters.entrySet()){
						double old_q_value = entry.getValue().getQValue();
						if(entry.getValue().getPValue() < 2){
							entry.getValue().setPValue(hoeldergranularity + entry.getValue().getPValue());
						}
						else{
							entry.getValue().setQValue(-hoeldergranularity + entry.getValue().getQValue());
						}
						entry.getValue().setQValue(-hoeldergranularity + entry.getValue().getQValue());
						try{
							new_backlogprob = input.evaluate(theta, 0 , 0);
						}
						catch(ServerOverloadException e){
							new_backlogprob = Double.POSITIVE_INFINITY;
						}
						catch(ThetaOutOfBoundException e){
							new_backlogprob = Double.POSITIVE_INFINITY;
						}
						if(backlogprob > new_backlogprob){
							backlogprob = new_backlogprob;
							changed_hoelder = entry.getKey();
							change = SimpleGradient.Change.HOELDER_Q;
						}

						entry.getValue().setQValue(old_q_value);
					}

					switch(change){
					case THETA_INC:
						theta = theta + thetagranularity;
						improved = true;
						break;
					case THETA_DEC:
						theta = theta - thetagranularity;
						improved = true;
						break;
					case HOELDER_P:
						allparameters.get(changed_hoelder).setPValue(allparameters.get(changed_hoelder).getPValue() - hoeldergranularity);
						improved = true;
						break;
					case HOELDER_Q:
						allparameters.get(changed_hoelder).setQValue(allparameters.get(changed_hoelder).getQValue() - hoeldergranularity);
						improved = true;
						break;
					case NOTHING:
						improved = false;
						break;
					default:
						improved = false;
						break;
					}
					//System.out.println("Theta: "+theta+" Hoelder: "+allparameters.toString()+" Bound: "+backlogprob);
				}

				result = backlogprob;

				break;

			case DELAY:

				//Computes initial value
                                int delay = (int)Math.round(Math.ceil(bound));
				double delayprob;
				double new_delayprob;
				try{
					delayprob = input.evaluate(theta, delay, 0);
				}
				catch(ServerOverloadException e){
					delayprob = Double.POSITIVE_INFINITY;
				}

				while(improved){
					improved = false;
					change = SimpleGradient.Change.NOTHING;
					//Check if decreasing theta leads to a better result
					if(theta > thetagranularity){
						theta = theta - thetagranularity;
						try{
                                                    new_delayprob = input.evaluate(theta, delay, 0);
						}
						catch(ServerOverloadException e){
							new_delayprob = Double.POSITIVE_INFINITY;
						}
						if(delayprob > new_delayprob){
							delayprob = new_delayprob;
							change = SimpleGradient.Change.THETA_DEC;
						}
						theta = theta + thetagranularity;
					}

					//Check if increasing theta leads to a better result
					if(theta < max_theta - thetagranularity){
						theta = theta + thetagranularity;
						try{
							new_delayprob = input.evaluate(theta, delay, 0);
						}
						catch(ServerOverloadException e){
							new_delayprob = Double.POSITIVE_INFINITY;
						}
						if(delayprob > new_delayprob){
							delayprob = new_delayprob;
							change = SimpleGradient.Change.THETA_INC;
						}
						theta = theta - thetagranularity;
					}

					//Check each neighbor by decreasing the P-Value of Hoelder parameters
					for(Map.Entry<Integer, Hoelder> entry : allparameters.entrySet()){
						double old_p_value = entry.getValue().getPValue();
						if(entry.getValue().getPValue() < 2){
							entry.getValue().setPValue(-hoeldergranularity + entry.getValue().getPValue());
						}
						else{
							entry.getValue().setQValue(hoeldergranularity + entry.getValue().getQValue());
						}
						try{
							new_delayprob = input.evaluate(theta, delay, 0);
						}
						catch(ServerOverloadException e){
							new_delayprob = Double.POSITIVE_INFINITY;
						}
						catch(ThetaOutOfBoundException e){
							new_delayprob = Double.POSITIVE_INFINITY;
						}
						if(delayprob > new_delayprob){
							delayprob = new_delayprob;
							changed_hoelder = entry.getKey();
							change = SimpleGradient.Change.HOELDER_P;
						}
						entry.getValue().setPValue(old_p_value);
					}

					//Check each neighbor by decreasing the Q-Value of Hoelder parameters
					for(Map.Entry<Integer, Hoelder> entry : allparameters.entrySet()){
						double old_q_value = entry.getValue().getQValue();
						if(entry.getValue().getPValue() < 2){
							entry.getValue().setPValue(hoeldergranularity + entry.getValue().getPValue());
						}
						else{
							entry.getValue().setQValue(-hoeldergranularity + entry.getValue().getQValue());
						}
						try{
							new_delayprob = input.evaluate(theta, delay, 0);
						}
						catch(ServerOverloadException e){
							new_delayprob = Double.POSITIVE_INFINITY;
						}
						catch(ThetaOutOfBoundException e){
							new_delayprob = Double.POSITIVE_INFINITY;
						}
						if(delayprob > new_delayprob){
							delayprob = new_delayprob;
							changed_hoelder = entry.getKey();
							change = SimpleGradient.Change.HOELDER_Q;
						}
						entry.getValue().setQValue(old_q_value);
					}

					switch(change){
					case THETA_INC:
						theta = theta + thetagranularity;
						improved = true;
						break;
					case THETA_DEC:
						theta = theta - thetagranularity;
						improved = true;
						break;
					case HOELDER_P:
						allparameters.get(changed_hoelder).setPValue(allparameters.get(changed_hoelder).getPValue() + hoeldergranularity);
						improved = true;
						break;
					case HOELDER_Q:
						allparameters.get(changed_hoelder).setQValue(allparameters.get(changed_hoelder).getQValue() + hoeldergranularity);
						improved = true;
						break;
					case NOTHING:
						improved = false;
						break;
					default:
						improved = false;
						break;
					}
					//System.out.println("Theta: "+theta+" Hoelder: "+allparameters.toString()+" Bound: "+delayprob);
				}

				result = delayprob;

				break;
			case OUTPUT:
				//In case of an output-bound no result is needed
				result = Double.NaN;
				break;
			default:
				result = 0;
				break;
		}

		return result;
	}

	@Override
	public double Bound(Arrival input, Boundtype boundtype, double bound, double thetagranularity, double hoeldergranularity)
			throws ThetaOutOfBoundException, ParameterMismatchException, ServerOverloadException {

		double result;

		//Initializes the list of Hoelder-Parameters...
		HashMap<Integer, Hoelder> allparameters = new HashMap<Integer, Hoelder>(0);
		allparameters.putAll(input.getSigma().getParameters());
		allparameters.putAll(input.getRho().getParameters());

		//If needed, the parameter, which represents the backlog, must be separated from the other Hoelder parameters
		if(boundtype == AbstractAnalysis.Boundtype.BACKLOG){
                    allparameters.get(allparameters.size()).setPValue(bound);
                    allparameters.remove(allparameters.size());
		}
		for(Map.Entry<Integer, Hoelder> entry : allparameters.entrySet()){
			entry.getValue().setPValue(2);
		}

		//Initializes theta
		double max_theta = input.getThetastar();
		double sigmapart;
		double rhopart;
		double theta = thetagranularity;
		int changed_hoelder = Integer.MAX_VALUE;
		boolean improved = true;

		Change change = SimpleGradient.Change.NOTHING;

		switch(boundtype){
			case BACKLOG:

				//Computes initial value
				double backlogprob;
				double new_backlogprob;
				try{
					backlogprob = input.evaluate(theta, 0, 0);
				}
				catch(ServerOverloadException e){
					backlogprob = Double.POSITIVE_INFINITY;
				}
				while(improved){
					improved = false;
					change = SimpleGradient.Change.NOTHING;
					//Check if decreasing theta leads to a better result
					if(theta > thetagranularity){

						theta = theta - thetagranularity;
						try{
							new_backlogprob = input.evaluate(theta, 0, 0);
						}
						catch(ServerOverloadException e){
							new_backlogprob = Double.POSITIVE_INFINITY;
						}
						catch(ThetaOutOfBoundException e){
							new_backlogprob = Double.POSITIVE_INFINITY;
						}
						if(backlogprob > new_backlogprob){
							backlogprob = new_backlogprob;
							change = SimpleGradient.Change.THETA_DEC;
						}

						theta = theta + thetagranularity;
					}

					//Check if increasing theta leads to a better result
					if(theta < max_theta - thetagranularity){
						theta = theta + thetagranularity;
						try{
							new_backlogprob = input.evaluate(theta, 0 , 0);
						}
						catch(ServerOverloadException e){
							new_backlogprob = Double.POSITIVE_INFINITY;
						}
						catch(ThetaOutOfBoundException e){
							new_backlogprob = Double.POSITIVE_INFINITY;
						}
						if(backlogprob > new_backlogprob){
							backlogprob = new_backlogprob;
							change = SimpleGradient.Change.THETA_INC;
						}

						theta = theta - thetagranularity;
					}

					//Check each neighbors resulting from decreasing the P-Value of Hoelder parameters
					for(Map.Entry<Integer, Hoelder> entry : allparameters.entrySet()){
						double old_p_value = entry.getValue().getPValue();
						if(entry.getValue().getPValue() < 2){
							entry.getValue().setPValue(-hoeldergranularity + entry.getValue().getPValue());
						}
						else{
							entry.getValue().setQValue(hoeldergranularity + entry.getValue().getQValue());
						}
						try{
							new_backlogprob = input.evaluate(theta, 0, 0);
						}
						catch(ServerOverloadException e){
							new_backlogprob = Double.POSITIVE_INFINITY;
						}
						catch(ThetaOutOfBoundException e){
							new_backlogprob = Double.POSITIVE_INFINITY;
						}
						if(backlogprob > new_backlogprob){
							backlogprob = new_backlogprob;
							changed_hoelder = entry.getKey();
							change = SimpleGradient.Change.HOELDER_P;
						}

						entry.getValue().setPValue(old_p_value);
					}

					//Check each neighbor by decreasing the Q-Value of Hoelder parameters
					for(Map.Entry<Integer, Hoelder> entry : allparameters.entrySet()){
						double old_q_value = entry.getValue().getQValue();
						if(entry.getValue().getPValue() < 2){
							entry.getValue().setPValue(hoeldergranularity + entry.getValue().getPValue());
						}
						else{
							entry.getValue().setQValue(-hoeldergranularity + entry.getValue().getQValue());
						}
						entry.getValue().setQValue(-hoeldergranularity + entry.getValue().getQValue());
						try{
							new_backlogprob = input.evaluate(theta, 0 , 0);
						}
						catch(ServerOverloadException e){
							new_backlogprob = Double.POSITIVE_INFINITY;
						}
						catch(ThetaOutOfBoundException e){
							new_backlogprob = Double.POSITIVE_INFINITY;
						}
						if(backlogprob > new_backlogprob){
							backlogprob = new_backlogprob;
							changed_hoelder = entry.getKey();
							change = SimpleGradient.Change.HOELDER_Q;
						}

						entry.getValue().setQValue(old_q_value);
					}

					switch(change){
					case THETA_INC:
						theta = theta + thetagranularity;
						improved = true;
						break;
					case THETA_DEC:
						theta = theta - thetagranularity;
						improved = true;
						break;
					case HOELDER_P:
						allparameters.get(changed_hoelder).setPValue(allparameters.get(changed_hoelder).getPValue() - hoeldergranularity);
						improved = true;
						break;
					case HOELDER_Q:
						allparameters.get(changed_hoelder).setQValue(allparameters.get(changed_hoelder).getQValue() - hoeldergranularity);
						improved = true;
						break;
					case NOTHING:
						improved = false;
						break;
					default:
						improved = false;
						break;
					}
					//System.out.println("Theta: "+theta+" Hoelder: "+allparameters.toString()+" Bound: "+backlogprob);
				}

				result = backlogprob;

				break;

			case DELAY:

				//Computes initial value
                                int delay = (int)Math.round(Math.ceil(bound));
				double delayprob;
				double new_delayprob;
				try{
					delayprob = input.evaluate(theta, delay, 0);
				}
				catch(ServerOverloadException e){
					delayprob = Double.POSITIVE_INFINITY;
				}

				while(improved){
					improved = false;
					change = SimpleGradient.Change.NOTHING;
					//Check if decreasing theta leads to a better result
					if(theta > thetagranularity){
						theta = theta - thetagranularity;
						try{
                                                    new_delayprob = input.evaluate(theta, delay, 0);
						}
						catch(ServerOverloadException e){
							new_delayprob = Double.POSITIVE_INFINITY;
						}
						if(delayprob > new_delayprob){
							delayprob = new_delayprob;
							change = SimpleGradient.Change.THETA_DEC;
						}
						theta = theta + thetagranularity;
					}

					//Check if increasing theta leads to a better result
					if(theta < max_theta - thetagranularity){
						theta = theta + thetagranularity;
						try{
							new_delayprob = input.evaluate(theta, delay, 0);
						}
						catch(ServerOverloadException e){
							new_delayprob = Double.POSITIVE_INFINITY;
						}
						if(delayprob > new_delayprob){
							delayprob = new_delayprob;
							change = SimpleGradient.Change.THETA_INC;
						}
						theta = theta - thetagranularity;
					}

					//Check each neighbor by decreasing the P-Value of Hoelder parameters
					for(Map.Entry<Integer, Hoelder> entry : allparameters.entrySet()){
						double old_p_value = entry.getValue().getPValue();
						if(entry.getValue().getPValue() < 2){
							entry.getValue().setPValue(-hoeldergranularity + entry.getValue().getPValue());
						}
						else{
							entry.getValue().setQValue(hoeldergranularity + entry.getValue().getQValue());
						}
						try{
							new_delayprob = input.evaluate(theta, delay, 0);
						}
						catch(ServerOverloadException e){
							new_delayprob = Double.POSITIVE_INFINITY;
						}
						catch(ThetaOutOfBoundException e){
							new_delayprob = Double.POSITIVE_INFINITY;
						}
						if(delayprob > new_delayprob){
							delayprob = new_delayprob;
							changed_hoelder = entry.getKey();
							change = SimpleGradient.Change.HOELDER_P;
						}
						entry.getValue().setPValue(old_p_value);
					}

					//Check each neighbor by decreasing the Q-Value of Hoelder parameters
					for(Map.Entry<Integer, Hoelder> entry : allparameters.entrySet()){
						double old_q_value = entry.getValue().getQValue();
						if(entry.getValue().getPValue() < 2){
							entry.getValue().setPValue(hoeldergranularity + entry.getValue().getPValue());
						}
						else{
							entry.getValue().setQValue(-hoeldergranularity + entry.getValue().getQValue());
						}
						try{
							new_delayprob = input.evaluate(theta, delay, 0);
						}
						catch(ServerOverloadException e){
							new_delayprob = Double.POSITIVE_INFINITY;
						}
						catch(ThetaOutOfBoundException e){
							new_delayprob = Double.POSITIVE_INFINITY;
						}
						if(delayprob > new_delayprob){
							delayprob = new_delayprob;
							changed_hoelder = entry.getKey();
							change = SimpleGradient.Change.HOELDER_Q;
						}
						entry.getValue().setQValue(old_q_value);
					}

					switch(change){
					case THETA_INC:
						theta = theta + thetagranularity;
						improved = true;
						break;
					case THETA_DEC:
						theta = theta - thetagranularity;
						improved = true;
						break;
					case HOELDER_P:
						allparameters.get(changed_hoelder).setPValue(allparameters.get(changed_hoelder).getPValue() + hoeldergranularity);
						improved = true;
						break;
					case HOELDER_Q:
						allparameters.get(changed_hoelder).setQValue(allparameters.get(changed_hoelder).getQValue() + hoeldergranularity);
						improved = true;
						break;
					case NOTHING:
						improved = false;
						break;
					default:
						improved = false;
						break;
					}
					//System.out.println("Theta: "+theta+" Hoelder: "+allparameters.toString()+" Bound: "+delayprob);
				}

				result = delayprob;

				break;
			case OUTPUT:
				//In case of an output-bound no result is needed
				result = Double.NaN;
				break;
			default:
				result = 0;
				break;
		}

		return result;
	}

Replace Generic With Diamond HashMap<Integer,Hoelder> with HashMap<> in method public Bound(input Arrival, boundtype Boundtype, bound double, thetagranularity double, hoeldergranularity double) : double from class unikl.disco.calculator.optimization.SimpleGradient


/**
	 * This relays the command of calculating a symbolic (not optimized)
	 * bound to the corresponding {@link AbstractAnalysis}-subclass. The
	 * result is returned in arrival-representation.
	 * @param flow the Flow of interest.
	 * @param vertex the Vertex of interest.
	 * @param anaType the type of analysis used
	 * @param boundtype the type of bound, which needs to be computed.
	 * @return the result of the analysis in arrival-representation.
	 */
	public Arrival analyzeNetwork(Flow flow, Vertex vertex, AnalysisType anaType, AbstractAnalysis.Boundtype boundtype, Network nw){

		//Preparations
		Arrival bound = null;

		HashMap<Integer, Vertex> givenVertices = new HashMap<Integer, Vertex>();
		for(Entry<Integer, Vertex> entry : nw.getVertices().entrySet()){
			givenVertices.put(entry.getKey(), entry.getValue().copy());
		}

		HashMap<Integer, Flow> givenFlows = new HashMap<Integer, Flow>();
		for(Entry<Integer, Flow> entry : nw.getFlows().entrySet()){
			givenFlows.put(entry.getKey(), entry.getValue().copy());
		}

		int resetFlowID = nw.getFLOW_ID();
		int resetHoelderID = nw.getHOELDER_ID();
		int resetVertexID = nw.getVERTEX_ID();

		Analyzer analyzer = AnalysisFactory.getAnalyzer(anaType, nw, givenVertices, givenFlows, flow.getFlowID(), vertex.getVertexID(), boundtype);
                try {
                        bound = analyzer.analyze();
                } catch (    ArrivalNotAvailableException | DeadlockException | BadInitializationException e) {
                        e.printStackTrace();
                }

		//Resets the network
		nw.resetFLOW_ID(resetFlowID);
		nw.resetHOELDER_ID(resetHoelderID);
		nw.resetVERTEX_ID(resetVertexID);

		return bound;
	}

/**
	 * This relays the command of calculating a symbolic (not optimized)
	 * bound to the corresponding {@link AbstractAnalysis}-subclass. The
	 * result is returned in arrival-representation.
	 * @param flow the Flow of interest.
	 * @param vertex the Vertex of interest.
	 * @param anaType the type of analysis used
	 * @param boundtype the type of bound, which needs to be computed.
	 * @return the result of the analysis in arrival-representation.
	 */
	public Arrival analyzeNetwork(Flow flow, Vertex vertex, AnalysisType anaType, AbstractAnalysis.Boundtype boundtype, Network nw){

		//Preparations
		Arrival bound = null;

		HashMap<Integer, Vertex> givenVertices = new HashMap<Integer, Vertex>();
		for(Entry<Integer, Vertex> entry : nw.getVertices().entrySet()){
			givenVertices.put(entry.getKey(), entry.getValue().copy());
		}

		HashMap<Integer, Flow> givenFlows = new HashMap<Integer, Flow>();
		for(Entry<Integer, Flow> entry : nw.getFlows().entrySet()){
			givenFlows.put(entry.getKey(), entry.getValue().copy());
		}

		int resetFlowID = nw.getFLOW_ID();
		int resetHoelderID = nw.getHOELDER_ID();
		int resetVertexID = nw.getVERTEX_ID();

		Analyzer analyzer = AnalysisFactory.getAnalyzer(anaType, nw, givenVertices, givenFlows, flow.getFlowID(), vertex.getVertexID(), boundtype);
                try {
                        bound = analyzer.analyze();
                } catch (ArrivalNotAvailableException e) {
                        e.printStackTrace();
                } catch (DeadlockException e) {
                        e.printStackTrace();
                } catch (BadInitializationException e) {
                        e.printStackTrace();
                }

		//Resets the network
		nw.resetFLOW_ID(resetFlowID);
		nw.resetHOELDER_ID(resetHoelderID);
		nw.resetVERTEX_ID(resetVertexID);

		return bound;
	}

Merge Catch [catch(ArrivalNotAvailableException e), catch(DeadlockException e), catch(BadInitializationException e)] to catch(ArrivalNotAvailableException|DeadlockException|BadInitializationException e) in method public analyzeNetwork(flow Flow, vertex Vertex, anaType AnalysisType, boundtype AbstractAnalysis.Boundtype, nw Network) : Arrival from class unikl.disco.mgf.SNC


	/**
	 * Constructs the Analysis-Object, with all information needed
	 * to give the wished performance bound at the flow and service
	 * of interest.
	 * @param vertices the set of vertices in the network
	 * @param flows the set of flows in the network
	 * @param vertex_of_interest the vertex at which the performance
	 * bound is calculated
	 * @param flow_of_interest the flow for which the performance
	 * bound is calculated
	 * @param boundtype the type of bound, which should be
	 * calculated. Note: All performance bounds are given in
	 * {@Arrival}-representation.
	 */
	public SimpleAnalysis(Network nw, HashMap<Integer, Vertex> vertices, HashMap<Integer, Flow> flows, int flow_of_interest, int vertex_of_interest,  Boundtype boundtype){
		super(nw, vertices, flows, flow_of_interest, vertex_of_interest, boundtype);
		analyzableVertices = new Stack<>();
	}

	/**
	 * Constructs the Analysis-Object, with all information needed
	 * to give the wished performance bound at the flow and service
	 * of interest.
	 * @param vertices the set of vertices in the network
	 * @param flows the set of flows in the network
	 * @param vertex_of_interest the vertex at which the performance
	 * bound is calculated
	 * @param flow_of_interest the flow for which the performance
	 * bound is calculated
	 * @param boundtype the type of bound, which should be
	 * calculated. Note: All performance bounds are given in
	 * {@Arrival}-representation.
	 */
	public SimpleAnalysis(Network nw, HashMap<Integer, Vertex> vertices, HashMap<Integer, Flow> flows, int flow_of_interest, int vertex_of_interest,  Boundtype boundtype){
		super(nw, vertices, flows, flow_of_interest, vertex_of_interest, boundtype);
		can_serve = new Stack<Vertex>();
	}

Replace Generic With Diamond Stack<Vertex> with Stack<> in method public SimpleAnalysis(nw Network, vertices HashMap<Integer,Vertex>, flows HashMap<Integer,Flow>, flow_of_interest int, vertex_of_interest int, boundtype Boundtype) from class unikl.disco.mgf.network.SimpleAnalysis