    public OutputTxt(File file, Graph graph, String[] str, String type, int selectedNodeID) {
        try {
            //this is not OS Independent
            File f = new File("C:\\" + file.getName().replace(".xml", "") + "_" + type + ".txt");
            //create the file to store the data
            if (!f.exists()) {
                boolean newFile = f.createNewFile();
                System.out.println("FILE CREATED: "+newFile);
            }
            try (BufferedWriter output = new BufferedWriter(new FileWriter(f))) {
                if (type.equals("weights")) {
                    //str[i] = X.X%		NAME
                    //...
                    for (String s : str) output.write(s + "\r\n");
                    //update the user of success
                    new Concluder().warnWindow("Output weights to C:\\ successfully", 400, 100);
                } else if (type.equals("PCmatrix")) {
                    String[][] cellValue = {
                            {"", "", "", "", "", "", ""},
                            {"", "", "", "", "", "", ""},
                            {"", "", "", "", "", "", ""},
                            {"", "", "", "", "", "", ""},
                            {"", "", "", "", "", "", ""},
                            {"", "", "", "", "", "", ""},
                            {"", "", "", "", "", "", ""},
                    };//matrix used to store the input data in the form of string
                    int n = 0;
                    //fill all upper triangle elements
                    if (str.length == 3) {
                        for (int i = 0; i < 2; i++) {
                            for (int j = i + 1; j < 3; j++) {
                                cellValue[i][j] = SystemConfiguration.formatNumber(Float.parseFloat(str[n]));
                                n++;
                            }

                        }

                    } else if (str.length == 6) {
                        for (int i = 0; i < 3; i++) {
                            for (int j = i + 1; j < 4; j++) {
                                cellValue[i][j] = SystemConfiguration.formatNumber(Float.parseFloat(str[n]));
                                n++;
                            }

                        }

                    } else if (str.length == 10) {
                        for (int i = 0; i < 4; i++) {
                            for (int j = i + 1; j < 5; j++) {
                                cellValue[i][j] = SystemConfiguration.formatNumber(Float.parseFloat(str[n]));
                                n++;
                            }

                        }

                    } else if (str.length == 15) {
                        for (int i = 0; i < 5; i++) {
                            for (int j = i + 1; j < 6; j++) {
                                cellValue[i][j] = SystemConfiguration.formatNumber(Float.parseFloat(str[n]));
                                n++;
                            }

                        }

                    } else if (str.length == 21) {
                        for (int i = 0; i < 6; i++) {
                            for (int j = i + 1; j < 7; j++) {
                                cellValue[i][j] = SystemConfiguration.formatNumber(Float.parseFloat(str[n]));
                                n++;
                            }

                        }

                    }
                    for (int i = 0; i < graph.getNode(selectedNodeID).getChildCount(); i++) {
                        for (int j = 0; j < graph.getNode(selectedNodeID).getChildCount(); j++) {
                            //fill main diagonal
                            if (i == j) {
                                cellValue[i][j] = "1.00";
                            }
                            //fill lower triangle
                            if (i > j) {
                                cellValue[i][j] = SystemConfiguration.formatNumber(1 / Float.parseFloat(cellValue[j][i]));
                            }
                        }
                    }
                    //write PC to file
                    for (String[] strings : cellValue) {
                        for (int j = 0; j < cellValue.length; j++) {
                            output.write(strings[j] + " ");
                        }
                        output.write("\r\n");
                    }
                    new Concluder().warnWindow("Output PCmatrix to C:\\ successfully", 400, 100);
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public OutputTxt(File file, Graph graph, String str[], String type, int SelectedNodeID) {
        try {
            //this is not OS Independent
            File f = new File("C:\\" + file.getName().replace(".xml", "") + "_" + type + ".txt");
            //create the file to store the data
            if (!f.exists())
                f.createNewFile();
            BufferedWriter output = new BufferedWriter(new FileWriter(f));
            if (type.equals("weights")) {
                //str[i] = X.X%		NAME
                //...
                for (int i = 0; i < str.length; i++)
                    output.write(str[i] + "\r\n");
                //update the user of success
                new Concluder().warnWindow("Output weights to C:\\ successfully", 400, 100);
            } else if (type.equals("PCmatrix")) {
                String cellValue[][] = {
                        {"", "", "", "", "", "", ""},
                        {"", "", "", "", "", "", ""},
                        {"", "", "", "", "", "", ""},
                        {"", "", "", "", "", "", ""},
                        {"", "", "", "", "", "", ""},
                        {"", "", "", "", "", "", ""},
                        {"", "", "", "", "", "", ""},
                };//matrix used to store the input data in the form of string
                int n = 0;
                //fill all upper triangle elements
                if (str.length == 3) {
                    for (int i = 0; i < 2; i++) {
                        for (int j = i + 1; j < 3; j++) {
                            cellValue[i][j] = SystemConfiguration.formatNumber(Float.valueOf(str[n]));
                            n++;
                        }

                    }

                } else if (str.length == 6) {
                    for (int i = 0; i < 3; i++) {
                        for (int j = i + 1; j < 4; j++) {
                            cellValue[i][j] = SystemConfiguration.formatNumber(Float.valueOf(str[n]));
                            n++;
                        }

                    }

                } else if (str.length == 10) {
                    for (int i = 0; i < 4; i++) {
                        for (int j = i + 1; j < 5; j++) {
                            cellValue[i][j] = SystemConfiguration.formatNumber(Float.valueOf(str[n]));
                            n++;
                        }

                    }

                } else if (str.length == 15) {
                    for (int i = 0; i < 5; i++) {
                        for (int j = i + 1; j < 6; j++) {
                            cellValue[i][j] = SystemConfiguration.formatNumber(Float.valueOf(str[n]));
                            n++;
                        }

                    }

                } else if (str.length == 21) {
                    for (int i = 0; i < 6; i++) {
                        for (int j = i + 1; j < 7; j++) {
                            cellValue[i][j] = SystemConfiguration.formatNumber(Float.valueOf(str[n]));
                            n++;
                        }

                    }

                }
                for (int i = 0; i < graph.getNode(SelectedNodeID).getChildCount(); i++) {
                    for (int j = 0; j < graph.getNode(SelectedNodeID).getChildCount(); j++) {
                        //fill main diagonal
                        if (i == j) {
                            cellValue[i][j] = "1.00";
                        }
                        //fill lower triangle
                        if (i > j) {
                            cellValue[i][j] = SystemConfiguration.formatNumber(1 / Float.valueOf(cellValue[j][i]));
                        }
                    }
                }
                //write PC to file
                for (int i = 0; i < cellValue.length; i++) {
                    for (int j = 0; j < cellValue.length; j++) {
                        output.write(cellValue[i][j] + " ");
                    }
                    output.write("\r\n");
                }
                new Concluder().warnWindow("Output PCmatrix to C:\\ successfully", 400, 100);
            }
            output.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

Try With Resources try(BufferedWriter output=new BufferedWriter(new FileWriter(f))) in method public OutputTxt(file File, graph Graph, str String[], type String, selectedNodeID int) from class ca.laurentian.concluder.OutputTxt


  static <@Nullable T> lazy<@Nullable T> get(@¢ final Supplier<@Nullable T> ¢) {
    return new lazy<>() {
      /** Cached value; invalid cache if {@code null} */
      @Nullable T $;

      /** No need to be {@code synchronized} to make it thread safe. Instance is
       * always unique.
       * @Return value of the supplier */
      @Override @Nullable public T get() {
        set($ != null ? $ : ¢.get());
        return $;
      }

      void set(@Nullable final T value) {
        $ = value;
      }
    };
  }

  static <@Nullable T> lazy<@Nullable T> get(@¢ final Supplier<@Nullable T> ¢) {
    return new lazy<@Nullable T>() {
      /** Cached value; invalid cache if {@code null} */
      @Nullable T $;

      /** No need to be {@code synchronized} to make it thread safe. Instance is
       * always unique.
       * @Return value of the supplier */
      @Override @Nullable public T get() {
        set($ != null ? $ : ¢.get());
        return $;
      }

      void set(@Nullable T value) {
        $ = value;
      }
    };
  }

Replace Generic With Diamond lazy<@Nullable T> with lazy<> in method public get(¢ Supplier<@Nullable T>) : lazy<@Nullable T> from class fluent.ly.lazy


  public static <@Nullable T> Iterable<T> iterable() {
    return () -> new Iterator<>() {
      @Override public boolean hasNext() {
        return false;
      }

      @Override public T next() {
        return null;
      }
    };
  }

  public static <@Nullable T> Iterable<T> iterable() {
    return () -> new Iterator<T>() {
      @Override public boolean hasNext() {
        return false;
      }

      @Override public T next() {
        return null;
      }
    };
  }

Replace Generic With Diamond Iterator<T> with Iterator<> in method public iterable() : Iterable<T> from class an.empty


      @Override @NotNull public Iterator<T> iterator() {
        return new Iterator<>() {
          int current;

          @Override public boolean hasNext() {
            return current < ts.length;
          }

          @Override public T next() {
            return ts[current++];
          }
        };
      }

      @Override @NotNull public Iterator<T> iterator() {
        return new Iterator<T>() {
          int current;

          @Override public boolean hasNext() {
            return current < ts.length;
          }

          @Override public T next() {
            return ts[current++];
          }
        };
      }

Replace Generic With Diamond Iterator<T> with Iterator<> in method public iterator() : Iterator<T> from class an.iterable.over.new Iterable<>


  @SafeVarargs @NotNull static <T> Iterable<T> over(final T... ts) {
    return new Iterable<>() {
      @Override @NotNull public Iterator<T> iterator() {
        return new Iterator<>() {
          int current;

          @Override public boolean hasNext() {
            return current < ts.length;
          }

          @Override public T next() {
            return ts[current++];
          }
        };
      }
    };
  }

  @SafeVarargs @NotNull static <T> Iterable<T> over(final T... ts) {
    return new Iterable<T>() {
      @Override @NotNull public Iterator<T> iterator() {
        return new Iterator<T>() {
          int current;

          @Override public boolean hasNext() {
            return current < ts.length;
          }

          @Override public T next() {
            return ts[current++];
          }
        };
      }
    };
  }

Replace Generic With Diamond Iterator<T> with Iterator<> in method public over(ts T...) : Iterable<T> from class an.iterable


/** Convert an array of {@link Integer}s into an {@link Iterable}. For
   * example, to print the first Fibonacci numbers multiplied by the first prime
   * numbers, write:
   *
   *

   * for (Integer f: asIterable(1,1,2,3,5,8,13)
   *    for (Integer p: asIterable(2,3,5,7,11,13)
   *       System.out.println(f*p)
   *

   *
   * @param is what to iterate on (recall that a list of arguments of the same
   *        type is isomorphic to array parameters in Java
   * @return an {@link Iterable} over the array, which can then be used to to
   *         iterate over the parameter(s) */
  public static Iterable<Integer> asIterable(final @NotNull Integer... is) {
    // Create an object of a new anonymous class that
    // implements {@link Iterable}
    return () -> new Iterator<>() {
      int current;

      @Override public boolean hasNext() {
        return current < is.length;
      }

      @Override public Integer next() {
        return is[current++];
      }
    };
  }

/** Convert an array of {@link Integer}s into an {@link Iterable}. For
   * example, to print the first Fibonacci numbers multiplied by the first prime
   * numbers, write:
   *
   *

   * for (Integer f: asIterable(1,1,2,3,5,8,13)
   *    for (Integer p: asIterable(2,3,5,7,11,13)
   *       System.out.println(f*p)
   *

   *
   * @param is what to iterate on (recall that a list of arguments of the same
   *        type is isomorphic to array parameters in Java
   * @return an {@link Iterable} over the array, which can then be used to to
   *         iterate over the parameter(s) */
  public static Iterable<Integer> asIterable(final @NotNull Integer... is) {
    // Create an object of a new anonymous class that
    // implements {@link Iterable}
    return () -> new Iterator<Integer>() {
      int current;

      @Override public boolean hasNext() {
        return current < is.length;
      }

      @Override public Integer next() {
        return is[current++];
      }
    };
  }

Replace Generic With Diamond Iterator<Integer> with Iterator<> in method public asIterable(is Integer...) : Iterable<Integer> from class fluent.ly.as


  public static Iterable<Integer> asIterableLambda(final @NotNull Integer... is) {
    return () -> new Iterator<>() {
      int current;

      @Override public boolean hasNext() {
        return current < is.length;
      }

      @Override public Integer next() {
        return is[current++];
      }
    };
  }

  public static Iterable<Integer> asIterableLambda(final @NotNull Integer... is) {
    return () -> new Iterator<Integer>() {
      int current;

      @Override public boolean hasNext() {
        return current < is.length;
      }

      @Override public Integer next() {
        return is[current++];
      }
    };
  }

Replace Generic With Diamond Iterator<Integer> with Iterator<> in method public asIterableLambda(is Integer...) : Iterable<Integer> from class fluent.ly.as


  public static Iterable<Integer> asIterableEssence(final @NotNull Integer... is) {
    return () -> new Iterator<>() {
      int current;

      @Override public boolean hasNext() {
        return current < is.length;
      }

      @Override public Integer next() {
        return is[current++];
      }
    };
  }

  public static Iterable<Integer> asIterableEssence(final @NotNull Integer... is) {
    return () -> new Iterator<Integer>() {
      int current;

      @Override public boolean hasNext() {
        return current < is.length;
      }

      @Override public Integer next() {
        return is[current++];
      }
    };
  }

Replace Generic With Diamond Iterator<Integer> with Iterator<> in method public asIterableEssence(is Integer...) : Iterable<Integer> from class fluent.ly.as


    @Override public Iterator<Integer> iterator() {
      return new Iterator<>() {
        int current = from;

        @Override public boolean hasNext() {
          return infinite || current < to;
        }

        @Override public Integer next() {
          if (!hasNext())
            throw new NoSuchElementException();
          final int $ = current;
          current += delta;
          return box.box($);
        }
      };
    }

    @Override public Iterator<Integer> iterator() {
      return new Iterator<Integer>() {
        int current = from;

        @Override public boolean hasNext() {
          return infinite || current < to;
        }

        @Override public Integer next() {
          if (!hasNext())
            throw new NoSuchElementException();
          final int $ = current;
          current += delta;
          return box.box($);
        }
      };
    }

Replace Generic With Diamond Iterator<Integer> with Iterator<> in method public iterator() : Iterator<Integer> from class fluent.ly.range.rangeIter


  @NotNull static <T> Iterable<T> lastOf(final @NotNull Iterable<T> ¢) {
    return () -> new Iterator<>() {
      Iterator<T> $ = ¢.iterator();
      {
        $.next();
      }

      @Override public boolean hasNext() {
        return $.hasNext();
      }

      @Override public T next() {
        return $.next();
      }
    };
  }

  @NotNull static <T> Iterable<T> lastOf(final @NotNull Iterable<T> ¢) {
    return () -> new Iterator<T>() {
      Iterator<T> $ = ¢.iterator();
      {
        $.next();
      }

      @Override public boolean hasNext() {
        return $.hasNext();
      }

      @Override public T next() {
        return $.next();
      }
    };
  }

Replace Generic With Diamond Iterator<T> with Iterator<> in method public lastOf(¢ Iterable<T>) : Iterable<T> from class fluent.ly.the


  /** Gives the ability to perform an action on object {@code T} t, only if
   * predicate(t) takes place.
   * @param <T> __ of elements for which the rule is applicable
   * @param <R> __ of result of applying this rule
   * @param p a predicate
   * @return a lambda of type {@link OnApplicator}
   * @author Yossi Gil
   * @since 2017-03-10 */
  static <@Nullable T, @Nullable R> @Nullable OnApplicator<T, R> on(final Predicate<T> p) {
    return c -> new Rule.Stateful<>() {
      @Override public R fire() {
        c.accept(current());
        return null;
      }

      @Override public boolean ok(final T ¢) {
        return p.test(¢);
      }
    };
  }

  /** Gives the ability to perform an action on object {@code T} t, only if
   * predicate(t) takes place.
   * @param <T> __ of elements for which the rule is applicable
   * @param <R> __ of result of applying this rule
   * @param p a predicate
   * @return a lambda of type {@link OnApplicator}
   * @author Yossi Gil
   * @since 2017-03-10 */
  static <@Nullable T, @Nullable R> @Nullable OnApplicator<T, R> on(final Predicate<T> p) {
    return c -> new Rule.Stateful<T, R>() {
      @Override public R fire() {
        c.accept(current());
        return null;
      }

      @Override public boolean ok(final T ¢) {
        return p.test(¢);
      }
    };
  }

Replace Generic With Diamond Rule.Stateful<T,R> with Rule.Stateful<> in method public on(p Predicate<T>) : @Nullable OnApplicator<T,R> from class il.org.spartan.utils.Rule


  @Check default Rule<T, R> afterCheck(final Predicate<T> p) {
    return new Interceptor<>(this) {
      @Override public boolean check(final T ¢) {
        return inner.check(¢) && p.test(¢);
      }
    };
  }

  @Check default Rule<T, R> afterCheck(final Predicate<T> p) {
    return new Interceptor<T, R>(this) {
      @Override public boolean check(final T ¢) {
        return inner.check(¢) && p.test(¢);
      }
    };
  }

Replace Generic With Diamond Interceptor<T,R> with Interceptor<> in method public afterCheck(p Predicate<T>) : Rule<T,R> from class il.org.spartan.utils.Rule


  default Rule<T, R> beforeCheck(final Predicate<T> p) {
    return new Interceptor<>(this) {
      @Override public boolean check(final T ¢) {
        return p.test(¢) && inner.check(¢);
      }
    };
  }

  default Rule<T, R> beforeCheck(final Predicate<T> p) {
    return new Interceptor<T, R>(this) {
      @Override public boolean check(final T ¢) {
        return p.test(¢) && inner.check(¢);
      }
    };
  }

Replace Generic With Diamond Interceptor<T,R> with Interceptor<> in method public beforeCheck(p Predicate<T>) : Rule<T,R> from class il.org.spartan.utils.Rule


  @Test public void invariantKept() {
    ___.check(() -> {
      // TODO Auto-generated method stub
      ___.nothing();
      assert true;
    });
  }

  @Test public void invariantKept() {
    ___.check(new ___.Invariantable() {
      @Override public void check() {
        // TODO Auto-generated method stub
        ___.nothing();
        assert true;
      }
    });
  }

Replace Anonymous With Lambda fluent.ly.__Test.invariantKept.check.new ___.Invariantable with () -> {___.nothing(); in method public invariantKept() : void from class fluent.ly.__Test


    @Override @SuppressWarnings("unused") public Iterator<Integer> iterator() {
      return new Iterator<Integer>() {
        int current = from;

        @Override public boolean hasNext() {
          return infinite || (current < to);
        }

        @Override public Integer next() {
          if (!hasNext())
            throw new NoSuchElementException();
          final int $ = current;
          current += delta;
          return box.box($);
        }
      };
    }

Replace Generic With Diamond Iterator<Integer> with Iterator<> in method public iterator() : Iterator<Integer> from class fluent.ly.range.RangeIter


  @NotNull @SuppressWarnings("unused") static <T> Iterable<T> lastOf(final @NotNull Iterable<T> ¢) {
    return () -> new Iterator<T>() {
      Iterator<T> $ = ¢.iterator();
      {
        $.next();
      }

      @Override public boolean hasNext() {
        return $.hasNext();
      }

      @Override public T next() {
        return $.next();
      }
    };
  }


  /** Gives the ability to perform an action on object {@code T} t, only if
   * predicate(t) takes place.
   * @param <T> __ of elements for which the rule is applicable
   * @param <R> __ of result of applying this rule
   * @param p a predicate
   * @return a lambda of type {@link OnApplicator}
   * @author Yossi Gil
   * @since 2017-03-10 */
  static <@Nullable T, @Nullable R> @Nullable OnApplicator<T, R> on(final Predicate<T> p) {
    return c -> new Rule.Stateful<T,R>() {
      @Override public R fire() {
        c.accept(current());
        return null;
      }

      @Override public boolean ok(final T ¢) {
        return p.test(¢);
      }
    };
  }


  @Check default Rule<T, R> afterCheck(final Predicate<T> p) {
    return new Interceptor<T,R>(this) {
      @Override public boolean check(final T ¢) {
        return inner.check(¢) && p.test(¢);
      }
    };
  }


  default Rule<T, R> beforeCheck(final Predicate<T> p) {
    return new Interceptor<T,R>(this) {
      @Override public boolean check(final T ¢) {
        return p.test(¢) && inner.check(¢);
      }
    };
  }


  @SuppressWarnings("unused") public static <@Nullable T> Iterable<T> iterable() {
    return () -> new Iterator<T>() {
      @Override public boolean hasNext() {
        return false;
      }

      @Override public T next() {
        return null;
      }
    };
  }


  @SafeVarargs @NotNull  static <T> Iterable<T> over(final T... ts) {
    return new Iterable<>() {
      @Override @NotNull public Iterator<T> iterator() {
        return new Iterator<>() {
          int current;

          @Override public boolean hasNext() {
            return current < ts.length;
          }

          @Override public T next() {
            return ts[current++];
          }
        };
      }
    };
  }

  @SafeVarargs @NotNull @SuppressWarnings("unused") static <T> Iterable<T> over(final T... ts) {
    return new Iterable<T>() {
      @Override @NotNull public Iterator<T> iterator() {
        return new Iterator<T>() {
          int current;

          @Override public boolean hasNext() {
            return current < ts.length;
          }

          @Override public T next() {
            return ts[current++];
          }
        };
      }
    };
  }


    @Override public Iterator<Integer> iterator() {
      // TODO Auto-generated method stub
      return new Iterator<>() {
        int current = from;

        @Override public boolean hasNext() {
//          System.out.println(to);
          return infinite || ( current < to);
        }

        @Override public Integer next() {

          if (!hasNext())
            throw new NoSuchElementException();
          final int $ = current;
          current++;
          return Integer.valueOf($);
        }
      };
    }

    @Override public Iterator<Integer> iterator() {
      // TODO Auto-generated method stub
      return new Iterator<Integer>() {
        int current = from;

        @Override public boolean hasNext() {
//          System.out.println(to);
          return infinite || ( current < to);
        }

        @Override public Integer next() {

          if (!hasNext())
            throw new NoSuchElementException();
          final int $ = current;
          current++;
          return Integer.valueOf($);
        }
      };
    }


  @SuppressWarnings("unused") @SafeVarargs @NotNull static <T> Iterable<T> over(final T... ts) {
    return new Iterable<T>() {
      @Override @NotNull public Iterator<T> iterator() {
        return new Iterator<T>() {
          int current;

          @Override public boolean hasNext() {
            return current < ts.length;
          }

          @Override public T next() {
            return ts[current++];
          }
        };
      }
    };
  }


  @SuppressWarnings("unused") @NotNull static <T> Iterable<T> lastOf(final @NotNull Iterable<T> ¢) {
    return () -> new Iterator<T>() {
      Iterator<T> $ = ¢.iterator();
      {
        $.next();
      }

      @Override public boolean hasNext() {
        return $.hasNext();
      }

      @Override public T next() {
        return $.next();
      }
    };
  }


    @Override public Iterator<Integer> iterator() {
      return new Iterator<>() {
        int next = from;

        @Override public boolean hasNext() {
          return infinite || (inclusive ? next <= to : next < to);
        }

        @Override public Integer next() {
          if (!hasNext())
            throw new NoSuchElementException();
          final int $ = next;
          next += step;
          return Integer.valueOf($);
        }
      };
    }

    @Override public Iterator<Integer> iterator() {
      return new Iterator<Integer>() {
        int next = from;

        @Override public boolean hasNext() {
          return infinite || (inclusive ? next <= to : next < to);
        }

        @Override public Integer next() {
          if (!hasNext())
            throw new NoSuchElementException();
          final int $ = next;
          next += step;
          return Integer.valueOf($);
        }
      };
    }

Replace Generic With Diamond Iterator<Integer> with Iterator<> in method public iterator() : Iterator<Integer> from class fluent.ly.range.RangeIterator


  public static <@Nullable T> Iterable<T> iterable() {
    return () -> new Iterator<T>() {
      @Override public boolean hasNext() {
        return false;
      }

      @Override public T next() {
        return null;
      }
    };
  }

  public static <@Nullable T> Iterable<T> iterable() {
    return new Iterable<T>() {
      @Override public Iterator<T> iterator() {
        return new Iterator<T>() {
          @Override public boolean hasNext() {
            return false;
          }

          @Override public T next() {
            return null;
          }
        };
      }
    };
  }

Replace Anonymous With Lambda an.empty.iterable.new Iterable<T> with () -> new Iterator<T>(){ in method public iterable() : Iterable<T> from class an.empty


      @Override public Iterator<T> iterator() {
        return new Iterator<>() {
          @Override public boolean hasNext() {
            return false;
          }

          @Override public T next() {
            return null;
          }
        };
      }

      @Override public Iterator<T> iterator() {
        return new Iterator<T>() {
          @Override public boolean hasNext() {
            return false;
          }

          @Override public T next() {
            return null;
          }
        };
      }

Replace Generic With Diamond Iterator<T> with Iterator<> in method public iterator() : Iterator<T> from class an.empty.iterable.new Iterable<>


  public static <@Nullable T> Iterable<T> iterable() {
    return new Iterable<>() {
      @Override public Iterator<T> iterator() {
        return new Iterator<>() {
          @Override public boolean hasNext() {
            return false;
          }

          @Override public T next() {
            return null;
          }
        };
      }
    };
  }


  /** Creates an iterable for an array of objects
   * @param    < T > an arbitrary type
   * @param ts what to iterate on
   * @return an {@link Iterable} over the parameter */
  @SafeVarargs @NotNull static <T> Iterable<T> over(final T... ts) {
    return new Iterable<>() {
      @Override @NotNull public Iterator<T> iterator() {
        return new Iterator<>() {
          int current;

          @Override public boolean hasNext() {
            return current < ts.length;
          }

          @Override public T next() {
            return ts[current++];
          }
        };
      }
    };
  }

  /** Creates an iterable for an array of objects
   * @param    < T > an arbitrary type
   * @param ts what to iterate on
   * @return an {@link Iterable} over the parameter */
  @SafeVarargs @NotNull static <T> Iterable<T> over(final T... ts) {
    return new Iterable<T>() {
      @Override @NotNull public Iterator<T> iterator() {
        return new Iterator<T>() {
          int current;

          @Override public boolean hasNext() {
            return current < ts.length;
          }

          @Override public T next() {
            return ts[current++];
          }
        };
      }
    };
  }


/** Convert an array of {@link Integer}s into an {@link Iterable}. For example,
   * to print the first Fibonacci numbers multiplied by the first prime numbers,
   * write:
   *
   *

   * for (Integer f: asIterable(1,1,2,3,5,8,13)
   *    for (Integer p: asIterable(2,3,5,7,11,13)
   *       System.out.println(f*p)
   *

   *
   * @param is what to iterate on (recall that a list of arguments of the same
   *           type is isomorphic to array parameters in Java
   * @return an {@link Iterable} over the array, which can then be used to to
   *         iterate over the parameter(s) */
  public static Iterable<Integer> asIterable(final @NotNull Integer... is) {
    // Create an object of a new anonymous class that
    // implements {@link Iterable}
    return () -> new Iterator<>() {
      int current;

      @Override public boolean hasNext() {
        return current < is.length;
      }

      @Override public Integer next() {
        return is[current++];
      }
    };
  }

/** Convert an array of {@link Integer}s into an {@link Iterable}. For example,
   * to print the first Fibonacci numbers multiplied by the first prime numbers,
   * write:
   *
   *

   * for (Integer f: asIterable(1,1,2,3,5,8,13)
   *    for (Integer p: asIterable(2,3,5,7,11,13)
   *       System.out.println(f*p)
   *

   *
   * @param is what to iterate on (recall that a list of arguments of the same
   *           type is isomorphic to array parameters in Java
   * @return an {@link Iterable} over the array, which can then be used to to
   *         iterate over the parameter(s) */
  public static Iterable<Integer> asIterable(final @NotNull Integer... is) {
    // Create an object of a new anonymous class that
    // implements {@link Iterable}
    return () -> new Iterator<Integer>() {
      int current;

      @Override public boolean hasNext() {
        return current < is.length;
      }

      @Override public Integer next() {
        return is[current++];
      }
    };
  }


  static Iterable<Integer> asIterableEssence(final @NotNull Integer... is) {
    return () -> new Iterator<>() {
      int current;

      @Override public boolean hasNext() {
        return current < is.length;
      }

      @Override public Integer next() {
        return is[current++];
      }
    };
  }

  static Iterable<Integer> asIterableEssence(final @NotNull Integer... is) {
    return () -> new Iterator<Integer>() {
      int current;

      @Override public boolean hasNext() {
        return current < is.length;
      }

      @Override public Integer next() {
        return is[current++];
      }
    };
  }

Replace Generic With Diamond Iterator<Integer> with Iterator<> in method package asIterableEssence(is Integer...) : Iterable<Integer> from class fluent.ly.as


  @NotNull static <T> Iterable<T> lastOf(final @NotNull Iterable<T> ¢) {
    return () -> new Iterator<>() {
      final Iterator<T> $ = ¢.iterator();
      {
        $.next();
      }

      @Override public boolean hasNext() {
        return $.hasNext();
      }

      @Override public T next() {
        return $.next();
      }
    };
  }

  @NotNull static <T> Iterable<T> lastOf(final @NotNull Iterable<T> ¢) {
    return () -> new Iterator<T>() {
      final Iterator<T> $ = ¢.iterator();
      {
        $.next();
      }

      @Override public boolean hasNext() {
        return $.hasNext();
      }

      @Override public T next() {
        return $.next();
      }
    };
  }


  /** Gives the ability to perform an action on object {@code T} t, only if
   * predicate(t) takes place.
   * @param   <T> __ of elements for which the rule is applicable
   * @param   <R> __ of result of applying this rule
   * @param p a predicate
   * @return a lambda of type {@link OnApplicator}
   * @author Yossi Gil
   * @since 2017-03-10 */
  static <@Nullable T, @Nullable R> @Nullable OnApplicator<T, R> on(final Predicate<T> p) {
    return c -> new Rule.Stateful<>() {
      @Override public R fire() {
        c.accept(current());
        return null;
      }

      @Override public boolean ok(final T ¢) {
        return p.test(¢);
      }
    };
  }

  /** Gives the ability to perform an action on object {@code T} t, only if
   * predicate(t) takes place.
   * @param   <T> __ of elements for which the rule is applicable
   * @param   <R> __ of result of applying this rule
   * @param p a predicate
   * @return a lambda of type {@link OnApplicator}
   * @author Yossi Gil
   * @since 2017-03-10 */
  static <@Nullable T, @Nullable R> @Nullable OnApplicator<T, R> on(final Predicate<T> p) {
    return c -> new Rule.Stateful<T, R>() {
      @Override public R fire() {
        c.accept(current());
        return null;
      }

      @Override public boolean ok(final T ¢) {
        return p.test(¢);
      }
    };
  }


    /**
     * Runs callable with compactions paused and compactions including sstables matching sstablePredicate stopped
     *
     * @param callable what to do when compactions are paused
     * @param sstablesPredicate which sstables should we cancel compactions for
     * @param interruptValidation if we should interrupt validation compactions
     * @param interruptViews if we should interrupt view compactions
     * @param interruptIndexes if we should interrupt compactions on indexes. NOTE: if you set this to true your sstablePredicate
     *                         must be able to handle LocalPartitioner sstables!
     */
    public <V> V runWithCompactionsDisabled(Callable<V> callable, Predicate<SSTableReader> sstablesPredicate, boolean interruptValidation, boolean interruptViews, boolean interruptIndexes)
    {
        // synchronize so that concurrent invocations don't re-enable compactions partway through unexpectedly,
        // and so we only run one major compaction at a time
        synchronized (this)
        {
            logger.trace("Cancelling in-progress compactions for {}", metadata.name);
            Iterable<ColumnFamilyStore> toInterruptFor = interruptIndexes
                                                         ? concatWithIndexes()
                                                         : Collections.singleton(this);

            toInterruptFor = interruptViews
                             ? Iterables.concat(toInterruptFor, viewManager.allViewsCfs())
                             : toInterruptFor;

            try (CompactionManager.CompactionPauser pause = CompactionManager.instance.pauseGlobalCompaction();
                 CompactionManager.CompactionPauser pausedStrategies = pauseCompactionStrategies(toInterruptFor))
            {
                // interrupt in-progress compactions
                CompactionManager.instance.interruptCompactionForCFs(toInterruptFor, sstablesPredicate, interruptValidation);
                CompactionManager.instance.waitForCessation(toInterruptFor, sstablesPredicate);

                // doublecheck that we finished, instead of timing out
                for (ColumnFamilyStore cfs : toInterruptFor)
                {
                    if (cfs.getTracker().getCompacting().stream().anyMatch(sstablesPredicate))
                    {
                        logger.warn("Unable to cancel in-progress compactions for {}.  Perhaps there is an unusually large row in progress somewhere, or the system is simply overloaded.", metadata.name);
                        return null;
                    }
                }
                logger.trace("Compactions successfully cancelled");

                // run our task
                try
                {
                    return callable.call();
                }
                catch (Exception e)
                {
                    throw new RuntimeException(e);
                }
            }
        }
    }

    /**
     * Runs callable with compactions paused and compactions including sstables matching sstablePredicate stopped
     *
     * @param callable what to do when compactions are paused
     * @param sstablesPredicate which sstables should we cancel compactions for
     * @param interruptValidation if we should interrupt validation compactions
     * @param interruptViews if we should interrupt view compactions
     * @param interruptIndexes if we should interrupt compactions on indexes. NOTE: if you set this to true your sstablePredicate
     *                         must be able to handle LocalPartitioner sstables!
     */
    public <V> V runWithCompactionsDisabled(Callable<V> callable, Predicate<SSTableReader> sstablesPredicate, boolean interruptValidation, boolean interruptViews, boolean interruptIndexes)
    {
        // synchronize so that concurrent invocations don't re-enable compactions partway through unexpectedly,
        // and so we only run one major compaction at a time
        synchronized (this)
        {
            logger.trace("Cancelling in-progress compactions for {}", metadata.name);
            Iterable<ColumnFamilyStore> toInterruptFor = interruptIndexes
                                                         ? concatWithIndexes()
                                                         : Collections.singleton(this);

            toInterruptFor = interruptViews
                             ? Iterables.concat(toInterruptFor, viewManager.allViewsCfs())
                             : toInterruptFor;

            for (ColumnFamilyStore cfs : toInterruptFor)
                cfs.getCompactionStrategyManager().pause();
            try
            {
                // interrupt in-progress compactions
                CompactionManager.instance.interruptCompactionForCFs(toInterruptFor, sstablesPredicate, interruptValidation);
                CompactionManager.instance.waitForCessation(toInterruptFor, sstablesPredicate);

                // doublecheck that we finished, instead of timing out
                for (ColumnFamilyStore cfs : toInterruptFor)
                {
                    if (cfs.getTracker().getCompacting().stream().anyMatch(sstablesPredicate))
                    {
                        logger.warn("Unable to cancel in-progress compactions for {}.  Perhaps there is an unusually large row in progress somewhere, or the system is simply overloaded.", metadata.name);
                        return null;
                    }
                }
                logger.trace("Compactions successfully cancelled");

                // run our task
                try
                {
                    return callable.call();
                }
                catch (Exception e)
                {
                    throw new RuntimeException(e);
                }
            }
            finally
            {
                for (ColumnFamilyStore cfs : toInterruptFor)
                    cfs.getCompactionStrategyManager().resume();
            }
        }
    }

Try With Resources try(CompactionManager.CompactionPauser pause=CompactionManager.instance.pauseGlobalCompaction(); CompactionManager.CompactionPauser pausedStrategies=pauseCompactionStrategies(toInterruptFor)) in method public runWithCompactionsDisabled(callable Callable<V>, sstablesPredicate Predicate<SSTableReader>, interruptValidation boolean, interruptViews boolean, interruptIndexes boolean) : V from class org.apache.cassandra.db.ColumnFamilyStore


        public void close()
        {
            sessionCache.entrySet().removeIf(entry -> {
                try (Session s = entry.getValue())
                {
                    s.getCluster().close();
                    return true;
                }
                catch (Throwable t)
                {
                    logger.error("Could not close connection", t);
                    return false;
                }
            });
        }

        public void close()
        {
            for (Session s : sessionCache.values())
            {
                try
                {
                    s.close();
                    s.getCluster().close();
                }
                catch (Throwable t)
                {
                    logger.error("Could not close connection", t);
                }
            }
        }

Try With Resources try(Session s=entry.getValue()) in method public close() : void from class org.apache.cassandra.fqltool.QueryReplayer.DefaultSessionProvider


    @Override
    public void onEvent(MenuEvent menuEvent) {
        System.out.println(menuEvent);
        switch (menuEvent.event()) {
            case "start" -> {
                try {
                    Long score = new Lantrix(screen, new LangService(lang), minLetters, blockSet).process();
                    if (score !=0 ){
                        var scoreClient = new ScoreClient(APPLICATION_ID, getSectionId());
                        List<Score> scores = scoreClient.pushScore(userName, score);
                        showScore(scores);
                    }
                } catch (IOException | URISyntaxException | InterruptedException | FontFormatException e) {
                    e.printStackTrace();
                }
            }
            case "exit" -> exit = true;
            case "language" -> {
                lang = switch (menuEvent.param()) {
                    case "ENG" -> Lantrix.Lang.ENG;
                    case "RUS" -> Lantrix.Lang.RUS;
                    default -> Lantrix.Lang.ENG;
                };
            }
            case "minLetters" -> minLetters = Integer.parseInt(menuEvent.param());
            case "blockSet" -> {
                blockSet = switch (menuEvent.param()) {
                    case "BASE" -> Lantrix.BlockSet.BASE;
                    case "EXT" -> Lantrix.BlockSet.EXT;
                    default -> Lantrix.BlockSet.BASE;
                };
            }
            case "scores" -> {
                try {
                    var scoreClient = new ScoreClient("wordrix", getSectionId());
                    List<Score> scores = scoreClient.pullScore(0, 10);
                    showScore(scores);

                } catch (IOException e) {
                    throw new RuntimeException(e);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
            case "changeName" -> {
                try {
                    userName = getPlayerName();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
                prefs.put("userName", userName);
            }
        }
    }

    @Override
    public void onEvent(MenuEvent menuEvent) {
        System.out.println(menuEvent);
        switch (menuEvent.event()) {
            case "start" -> {
                try {
                    Long score = new Lantrix(screen, new LangService(lang), minLetters, blockSet).process();
                    if (score !=0 ){
                        var scoreClient = new ScoreClient(APPLICATION_ID, getSectionId());
                        List<Score> scores = scoreClient.pushScore(userName, score);
                        showScore(scores);
                    }
                } catch (IOException e) {
                    e.printStackTrace();
                } catch (URISyntaxException e) {
                    throw new RuntimeException(e);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                } catch (FontFormatException e) {
                    throw new RuntimeException(e);
                }
            }
            case "exit" -> exit = true;
            case "language" -> {
                lang = switch (menuEvent.param()) {
                    case "ENG" -> Lantrix.Lang.ENG;
                    case "RUS" -> Lantrix.Lang.RUS;
                    default -> Lantrix.Lang.ENG;
                };
            }
            case "minLetters" -> minLetters = Integer.parseInt(menuEvent.param());
            case "blockSet" -> {
                blockSet = switch (menuEvent.param()) {
                    case "BASE" -> Lantrix.BlockSet.BASE;
                    case "EXT" -> Lantrix.BlockSet.EXT;
                    default -> Lantrix.BlockSet.BASE;
                };
            }
            case "scores" -> {
                try {
                    var scoreClient = new ScoreClient("wordrix", getSectionId());
                    List<Score> scores = scoreClient.pullScore(0, 10);
                    showScore(scores);

                } catch (IOException e) {
                    throw new RuntimeException(e);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
            case "changeName" -> {
                try {
                    userName = getPlayerName();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
                prefs.put("userName", userName);
            }
        }
    }

Merge Catch [catch(IOException e), catch(URISyntaxException e), catch(InterruptedException e), catch(FontFormatException e)] to catch(IOException|URISyntaxException|InterruptedException|FontFormatException e) in method public onEvent(menuEvent MenuEvent) : void from class link.sigma5.wordrix.Menu


    public void customFont(JLabel label) {
        try {
            //create the font to use. Specify the size!
            Font customFont = Font.createFont(Font.TRUETYPE_FONT, new File("res/LuckiestGuy.ttf")).deriveFont(25f);
            GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
            //register the font
            ge.registerFont(customFont);
            label.setFont(customFont);
        } catch (IOException | FontFormatException e ) {
            e.printStackTrace();
        }
    }

    public void customFont(JLabel label) {
        try {
            //create the font to use. Specify the size!
            Font customFont = Font.createFont(Font.TRUETYPE_FONT, new File("res/LuckiestGuy.ttf")).deriveFont(25f);
            GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
            //register the font
            ge.registerFont(customFont);
            label.setFont(customFont);
        } catch (IOException e ) {
            e.printStackTrace();
        } catch(FontFormatException e) {
            e.printStackTrace();
        }
    }

Merge Catch [catch(IOException e), catch(FontFormatException e)] to catch(IOException|FontFormatException e) in method public customFont(label JLabel) : void from class mainscreenpanel.CongratsPanel


   public void customFont(JLabel label) {
       try {
            //create the font to use. Specify the size!
            Font customFont = Font.createFont(Font.TRUETYPE_FONT, new File("res/LuckiestGuy.ttf")).deriveFont(30f);
            GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
            //register the font
            ge.registerFont(customFont);
            label.setFont(customFont);
        } catch (IOException | FontFormatException e ) {
            e.printStackTrace();
        }
   }

   public void customFont(JLabel label) {
       try {
            //create the font to use. Specify the size!
            Font customFont = Font.createFont(Font.TRUETYPE_FONT, new File("res/LuckiestGuy.ttf")).deriveFont(30f);
            GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
            //register the font
            ge.registerFont(customFont);
            label.setFont(customFont);
        } catch (IOException e ) {
            e.printStackTrace();
        } catch(FontFormatException e) {
            e.printStackTrace();
        }
   }

Merge Catch [catch(IOException e), catch(FontFormatException e)] to catch(IOException|FontFormatException e) in method public customFont(label JLabel) : void from class mainscreenpanel.MenuPanel


  private static JduFile buildDirectory(Path path, Arguments args, int depth) throws JduException {
    try (var contentStream = list(path)) {
      Path[] contentArray = contentStream.toArray(Path[]::new);
      List<JduFile> content = new ArrayList<>();

      for (Path p : contentArray) {
        JduFile file = JduBuilder.build(p, args, depth + 1);
        content.add(file);
      }
      return new JduDirectory(path, depth, content);
    } catch (IOException e) {
      // TODO: log "can't read directory"
      throw new JduException("can't read directory \"" + path.getFileName() + "\"");
    }
  }

  private static JduFile buildDirectory(Path path, Arguments args, int depth) throws JduException {
    try {
      List<JduFile> content = new ArrayList<>();
      Path[] contentArray = list(path).toArray(Path[]::new);
      for (Path p : contentArray) {
        JduFile file = JduBuilder.build(p, args, depth + 1);
        content.add(file);
      }
      // CR: move to print stage
      content.sort((p1, p2) -> -Long.compare(p1.byteSize, p2.byteSize));
      return new JduDirectory(path, depth, content);
    } catch (IOException e) {
      throw new JduException("can't read directory \"" + path.getFileName() + "\"");
    }
  }

Try With Resources try(var contentStream=list(path)) in method private buildDirectory(path Path, args Arguments, depth int) : JduFile from class ru.nsu.fit.akitov.jdu.model.JduBuilder


    @Override
    public void run() {
      try (kafkaConsumer) {
        kafkaConsumer.subscribe(topics);
        while (!isDone) {
          // Kafka transmits messages in compressed JSON format.
          // Records are key value pairs per JSON
          //
          // Payloads are wrapped with TEObjects which are serialized into bytes then passed to Kafka,
          // which then serializes the bytes into a key-value JSON object for compressed transmission.
          //
          // Processing at the recipient container happens in the reverse order.
          // The consumer receives the bytes from deserializing the received JSON message, then
          // deserializes the TEObject, which contains the payload object.
          ConsumerRecords<String, byte[]> consumerRecords;
          try {
            consumerRecords = kafkaConsumer.poll(100);
          } catch (Exception ex) {
            LOGGER.info("Kafka broker exception " + ex.getMessage());
            continue;
          }
          for (ConsumerRecord<String, byte[]> consumerRecord : consumerRecords) {
            if (LOGGER.isDebugEnabled()) {
              LOGGER.debug("received consumerRecord " + consumerRecord);
            }
            final byte[] serializedTEObject = consumerRecord.value();
            final TEObject teObject;
            try {
              teObject = (TEObject) Serialization.deserialize(serializedTEObject);
            } catch (Exception ex) {
              if (ex instanceof InvalidClassException) {
                LOGGER.warn("  dropping old version of TEObject");
                continue;
              } else {
                throw new RuntimeException(ex);
              }
            }
            if (LOGGER.isDebugEnabled()) {
              LOGGER.debug("  deserialized teObject " + teObject);
            }
            final DemoPayload demoPayload = (DemoPayload) Serialization.deserialize(teObject.getPayloadBytes());
            if (LOGGER.isDebugEnabled()) {
              LOGGER.debug("  deserialized message " + demoPayload);
            }
          }
        }

        /**
         * Note that InterruptedExceptions can occur when the consumer thread is closed, which are ignorable.
         */
        LOGGER.info("quitting the Kafka consumer loop thread");
      } catch (WakeupException ex) {
        // ignore for shutdown
      }
    }

    @Override
    public void run() {
      try {
        LOGGER.info("subscribing to " + topics);
        kafkaConsumer.subscribe(topics);
        while (!isDone) {
          // Kafka transmits messages in compressed JSON format.
          // Records are key value pairs per JSON
          //
          // In the Kafka Blockchain, the blockchain name is the topic.
          // The key is provided by the caller.
          // Kafka Blockchain Messages are wrapped with TEObjects which are serialized into bytes then passed to Kafka,
          // which then serializes the bytes into a key-value JSON object for compressed transmission.
          //
          // Processing at the recipient container happens in the reverse order.
          // The consumer receives the bytes from deserializing the received JSON message, then
          // deserializes the TEObject, which contains the Message object.
          LOGGER.info("consumer loop poll...");
          ConsumerRecords<String, byte[]> consumerRecords = kafkaConsumer.poll(Long.MAX_VALUE); // timeout
          for (ConsumerRecord<String, byte[]> consumerRecord : consumerRecords) {
            LOGGER.info("received consumerRecord " + consumerRecord);
            final byte[] serializedTEObject = consumerRecord.value();
            final TEObject teObject = (TEObject) Serialization.deserialize(serializedTEObject);
            LOGGER.info("  deserialized teObject " + teObject);
            String string = null;
            try {
              string = new String((byte[]) teObject.getPayload(), "UTF-8");
            } catch (UnsupportedEncodingException ex) {
              fail(ex.getMessage());
            }
            LOGGER.info("  payload string: " + string);
            synchronized (RECEIVED_TEST_MESSAGES) {
              RECEIVED_TEST_MESSAGES.add(string);
            }
          }
        }
      } catch (WakeupException e) {
        // ignore for shutdown
      } finally {
        LOGGER.info("closing the consumer loop...");
        kafkaConsumer.commitSync();
        kafkaConsumer.unsubscribe();
        kafkaConsumer.close(
                1, // timeout
                TimeUnit.SECONDS);
      }
    }

Try With Resources try(kafkaConsumer) in method public run() : void from class com.ai_blockchain.samples.KafkaBlockchainBenchmark.ConsumerLoop


    public static void main(String[] args) {
        FraudeDetectorService fraudeDetectorService = new FraudeDetectorService();
        try (KafkaService service = new KafkaService<>(FraudeDetectorService.class.getSimpleName(), "ECOMMERCE_NEW_ORDER",
                fraudeDetectorService::parse, Order.class, new HashMap<>())) {
            service.run();
        }
    }

    public static void main(String[] args) {
        FraudeDetectorService fraudeDetectorService = new FraudeDetectorService();
        try (KafkaService service = new KafkaService<Order>(FraudeDetectorService.class.getSimpleName(), "ECOMMERCE_NEW_ORDER",
                fraudeDetectorService::parse, Order.class, new HashMap<>())) {
            service.run();
        }
    }

Replace Generic With Diamond KafkaService<Order> with KafkaService<> in method public main(args String[]) : void from class br.com.caioalura.ecommerce.ecommerce.FraudeDetectorService


    public ModifyExerciseFrame(Admin administrador, String codigo, String titulo, String desc, String concepto, String recurso, String tipo) throws JSchException, SQLException {
        // Configuración de la ventana
        setSize(500, 475);
        getContentPane().setLayout(new BorderLayout(5, 5));
        setTitle("Modificar ejercicio olímpico");
        setTitle("Modificar ejercicio olímpico");
        setVisible(true);
        setLocationRelativeTo(null);
        setIconImage(iconoVentana);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        String oldCode = codigo;

        // Panel superior
        introduceData = new JLabel("Edición de ejercicio");
        introduceData.setFont(fuenteTitulo);

        goBackButton = new JButton("< Volver");
        goBackButton.setFont(fuenteBotonesEtiquetas);
        goBackButton.setPreferredSize(new Dimension(90, 30));

        upperPanel = new JPanel();
        upperPanel.setLayout(new BorderLayout(5, 5));
        upperPanel.add(introduceData, BorderLayout.CENTER);
        upperPanel.add(goBackButton, BorderLayout.EAST);
        upperPanel.setBorder(borde);

        // Panel de inputs
        exerCode = new JLabel("Código (*)");
        exerCode.setFont(fuenteBotonesEtiquetas);

        exerName = new JLabel("Nombre (*)");
        exerName.setFont(fuenteBotonesEtiquetas);

        exerDesc = new JLabel("Descripción");
        exerDesc.setFont(fuenteBotonesEtiquetas);

        exerConcept = new JLabel("Categoría (*)");
        exerConcept.setFont(fuenteBotonesEtiquetas);

        exerResources = new JLabel("Recursos (*)");
        exerResources.setFont(fuenteBotonesEtiquetas);

        exerType = new JLabel("Tipo (*)");
        exerType.setFont(fuenteBotonesEtiquetas);

        exerRubrica = new JLabel("Rúbrica (*)");
        exerRubrica.setFont(fuenteBotonesEtiquetas);

        exerCodeField = new JTextField(codigo);
        exerCodeField.setFont(fuenteCampoTexto);

        exerNameField = new JTextField(titulo);
        exerNameField.setFont(fuenteCampoTexto);

        exerDescField = new JTextField(desc);
        exerDescField.setFont(fuenteCampoTexto);

        String[] exerConcepts = {"Abstracción", "Algoritmos", "Bucles", "Condicionales", "Descomposición", "Funciones",
                "IA", "Reconocimiento de patrones", "Secuencias", "Secuencias y bucles", "Variables", "Variables y funciones", "Otro"};

        exerConceptField = new JComboBox<>(exerConcepts);
        exerConceptField.setFont(fuenteCampoTexto);
        if (!concepto.equals("IA")) {
            String substring = concepto.substring(1);
            substring = substring.toLowerCase();
            concepto = concepto.charAt(0) + substring;
        }
        exerConceptField.setSelectedItem(concepto);

        String[] exerResource = {"INICIAL", "INTERMEDIO"};
        exerResourcesField = new JComboBox<>(exerResource);
        exerResourcesField.setFont(fuenteCampoTexto);
        exerResourcesField.setSelectedItem(recurso);

        String[] exerTypes = {"Desenchufada", "Enchufada"};
        exerTypeField = new JComboBox<>(exerTypes);
        exerTypeField.setFont(fuenteCampoTexto);

        String substring = tipo.substring(1);
        substring = substring.toLowerCase();
        tipo = tipo.charAt(0) + substring;
        exerTypeField.setSelectedItem(tipo);

        exerRubricaField = new JComboBox<>();
        exerRubricaField.setFont(fuenteCampoTexto);

        ResultSet rubricCodes = administrador.selectCol("T_RUBRICAS", "CODIGO");

        // Se añaden los registros al combo box
        while (rubricCodes.next()) {
            String registro = rubricCodes.getString("CODIGO");
            exerRubricaField.addItem(registro);

        }

        rubricCodes.close();

        // Panel de botón modificar
        modifyExerButton = new JButton("Modificar ejercicio olímpico");
        modifyExerButton.setPreferredSize(new Dimension(250, 30));
        modifyExerButton.setFont(fuenteBotonesEtiquetas);

        JPanel createButtonPanel = new JPanel();
        createButtonPanel.setBorder(borde);
        createButtonPanel.add(modifyExerButton);

        inputPanel = new JPanel();
        inputPanel.setBorder(borde);
        inputPanel.setLayout(new GridLayout(7, 2, 10, 10));

        inputPanel.add(exerCode);
        inputPanel.add(exerCodeField);
        inputPanel.add(exerName);
        inputPanel.add(exerNameField);
        inputPanel.add(exerDesc);
        inputPanel.add(exerDescField);
        inputPanel.add(exerConcept);
        inputPanel.add(exerConceptField);
        inputPanel.add(exerResources);
        inputPanel.add(exerResourcesField);
        inputPanel.add(exerType);
        inputPanel.add(exerTypeField);
        inputPanel.add(exerRubrica);
        inputPanel.add(exerRubricaField);

        // Se añaden los paneles a la ventana
        add(upperPanel, BorderLayout.NORTH);
        add(inputPanel, BorderLayout.CENTER);
        add(createButtonPanel, BorderLayout.SOUTH);

        // Botón de volver
        goBackButton.addActionListener(e -> {
            try {
                new CheckExercisesFrame(administrador);
            } catch (JSchException | SQLException ex) {
                throw new RuntimeException(ex);
            }
            dispose();
        });

        //
        modifyExerButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                if (exerCodeField.getText().matches("^\\s*$")
                        || exerNameField.getText().matches("^\\s*$")) {
                    new ErrorJOptionPane("Los campos Código, Nombre, Concepto, Recursos, Tipo y Rúbrica son obligatorios");

                } else {
                    String code = exerCodeField.getText();
                    String name = exerNameField.getText();
                    String desc = exerDescField.getText();
                    String concept = (String) exerConceptField.getSelectedItem();
                    String resources = (String) exerResourcesField.getSelectedItem();
                    String type = (String) exerTypeField.getSelectedItem();
                    String rubric = (String) exerRubricaField.getSelectedItem();

                    try {
                        if (administrador.modifyExercise(oldCode, code, name, desc, concept, resources, type, rubric) == 0) {
                            new CheckExercisesFrame(administrador);
                            dispose();

                        }

                    } catch (JSchException | SQLException ex) {
                        new ErrorJOptionPane(ex.getMessage());
                    }
                }
            }
        });

    }

    public VentanaModificarEjercicio(Administrador administrador, String codigo, String titulo, String desc, String concepto, String recurso, String tipo) throws JSchException, SQLException {
        // Configuración de la ventana
        setSize(500, 475);
        getContentPane().setLayout(new BorderLayout(5, 5));
        setTitle("Modificar ejercicio olímpico");
        setTitle("Modificar ejercicio olímpico");
        setVisible(true);
        setLocationRelativeTo(null);
        setIconImage(iconoVentana);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        String oldCode = codigo;

        // Panel superior
        introduceData = new JLabel("Edición de ejercicio");
        introduceData.setFont(fuenteTitulo);

        goBackButton = new JButton("< Volver");
        goBackButton.setFont(fuenteBotonesEtiquetas);
        goBackButton.setPreferredSize(new Dimension(90, 30));

        upperPanel = new JPanel();
        upperPanel.setLayout(new BorderLayout(5, 5));
        upperPanel.add(introduceData, BorderLayout.CENTER);
        upperPanel.add(goBackButton, BorderLayout.EAST);
        upperPanel.setBorder(borde);

        // Panel de inputs
        exerCode = new JLabel("Código (*)");
        exerCode.setFont(fuenteBotonesEtiquetas);

        exerName = new JLabel("Nombre (*)");
        exerName.setFont(fuenteBotonesEtiquetas);

        exerDesc = new JLabel("Descripción");
        exerDesc.setFont(fuenteBotonesEtiquetas);

        exerConcept = new JLabel("Categoría (*)");
        exerConcept.setFont(fuenteBotonesEtiquetas);

        exerResources = new JLabel("Recursos (*)");
        exerResources.setFont(fuenteBotonesEtiquetas);

        exerType = new JLabel("Tipo (*)");
        exerType.setFont(fuenteBotonesEtiquetas);

        exerRubrica = new JLabel("Rúbrica (*)");
        exerRubrica.setFont(fuenteBotonesEtiquetas);

        exerCodeField = new JTextField(codigo);
        exerCodeField.setFont(fuenteCampoTexto);

        exerNameField = new JTextField(titulo);
        exerNameField.setFont(fuenteCampoTexto);

        exerDescField = new JTextField(desc);
        exerDescField.setFont(fuenteCampoTexto);

        String[] exerConcepts = {"Abstracción", "Algoritmos", "Bucles", "Condicionales", "Descomposición", "Funciones",
                "IA", "Reconocimiento de patrones", "Secuencias", "Secuencias y bucles", "Variables", "Variables y funciones", "Otro"};

        exerConceptField = new JComboBox<>(exerConcepts);
        exerConceptField.setFont(fuenteCampoTexto);
        if (!concepto.equals("IA")) {
            String substring = concepto.substring(1);
            substring = substring.toLowerCase();
            concepto = concepto.charAt(0) + substring;
        }
        exerConceptField.setSelectedItem(concepto);

        String[] exerResource = {"INICIAL", "INTERMEDIO"};
        exerResourcesField = new JComboBox<>(exerResource);
        exerResourcesField.setFont(fuenteCampoTexto);
        exerResourcesField.setSelectedItem(recurso);

        String[] exerTypes = {"Desenchufada", "Enchufada"};
        exerTypeField = new JComboBox<>(exerTypes);
        exerTypeField.setFont(fuenteCampoTexto);

        String substring = tipo.substring(1);
        substring = substring.toLowerCase();
        tipo = tipo.charAt(0) + substring;
        exerTypeField.setSelectedItem(tipo);

        exerRubricaField = new JComboBox<>();
        exerRubricaField.setFont(fuenteCampoTexto);

        ResultSet rubricCodes = administrador.selectCol("T_RUBRICAS", "CODIGO");

        // Se añaden los registros al combo box
        while (rubricCodes.next()) {
            String registro = rubricCodes.getString("CODIGO");
            exerRubricaField.addItem(registro);

        }

        rubricCodes.close();

        // Panel de botón modificar
        modifyExerButton = new JButton("Modificar ejercicio olímpico");
        modifyExerButton.setPreferredSize(new Dimension(250, 30));
        modifyExerButton.setFont(fuenteBotonesEtiquetas);

        JPanel createButtonPanel = new JPanel();
        createButtonPanel.setBorder(borde);
        createButtonPanel.add(modifyExerButton);

        inputPanel = new JPanel();
        inputPanel.setBorder(borde);
        inputPanel.setLayout(new GridLayout(7, 2, 10, 10));

        inputPanel.add(exerCode);
        inputPanel.add(exerCodeField);
        inputPanel.add(exerName);
        inputPanel.add(exerNameField);
        inputPanel.add(exerDesc);
        inputPanel.add(exerDescField);
        inputPanel.add(exerConcept);
        inputPanel.add(exerConceptField);
        inputPanel.add(exerResources);
        inputPanel.add(exerResourcesField);
        inputPanel.add(exerType);
        inputPanel.add(exerTypeField);
        inputPanel.add(exerRubrica);
        inputPanel.add(exerRubricaField);

        // Se añaden los paneles a la ventana
        add(upperPanel, BorderLayout.NORTH);
        add(inputPanel, BorderLayout.CENTER);
        add(createButtonPanel, BorderLayout.SOUTH);

        // Botón de volver
        goBackButton.addActionListener(e -> {
            try {
                new VentanaConsultaEjercicios(administrador);
            } catch (JSchException | SQLException ex) {
                throw new RuntimeException(ex);
            }
            dispose();
        });

        //
        modifyExerButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                if (exerCodeField.getText().matches("^\\s*$")
                        || exerNameField.getText().matches("^\\s*$")) {
                    new ErrorJOptionPane("Los campos Código, Nombre, Concepto, Recursos, Tipo y Rúbrica son obligatorios");

                } else {
                    String code = exerCodeField.getText();
                    String name = exerNameField.getText();
                    String desc = exerDescField.getText();
                    String concept = (String) exerConceptField.getSelectedItem();
                    String resources = (String) exerResourcesField.getSelectedItem();
                    String type = (String) exerTypeField.getSelectedItem();
                    String rubric = (String) exerRubricaField.getSelectedItem();

                    try {
                        if (administrador.modifyExercise(oldCode, code, name, desc, concept, resources, type, rubric) == 0) {
                            new VentanaConsultaEjercicios(administrador);
                            dispose();

                        }

                    } catch (JSchException | SQLException ex) {
                        new ErrorJOptionPane(ex.getMessage());
                    }
                }
            }
        });

    }

Replace Anonymous With Lambda interfaz.administrador.VentanaModificarEjercicio.VentanaModificarEjercicio.addActionListener.new ActionListener with e -> {trynew CheckExercisesFrame(administrador); in method public ModifyExerciseFrame(administrador Admin, codigo String, titulo String, desc String, concepto String, recurso String, tipo String) from class interfaz.admin.ModifyExerciseFrame


    public VentanaNuevaAsignacionEjOlimp(Administrador administrador) throws JSchException, SQLException {
        // Configuración de la ventana
        setSize(500, 290);
        getContentPane().setLayout(new BorderLayout(5, 5));
        this.setTitle("Nueva asignación");
        this.setVisible(true);
        setLocationRelativeTo(null);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        // Icono de la ventana
        setIconImage(iconoVentana);

        introduceData = new JLabel("Nueva asignación");
        introduceData.setFont(fuenteTitulo);

        goBackButton = new JButton("< Volver");
        goBackButton.setFont(fuenteBotonesEtiquetas);
        goBackButton.setPreferredSize(new Dimension(90, 30));

        upperPanel = new JPanel();
        upperPanel.setLayout(new BorderLayout(5, 5));
        upperPanel.add(introduceData, BorderLayout.CENTER);
        upperPanel.add(goBackButton, BorderLayout.EAST);
        upperPanel.setBorder(borde);

        exerCode = new JLabel("Ejercicio (*)");
        exerCode.setFont(fuenteBotonesEtiquetas);

        olympCode = new JLabel("Olimpiada (*)");
        olympCode.setFont(fuenteBotonesEtiquetas);

        itinerarioCode = new JLabel("Itinerario (*)");
        itinerarioCode.setFont(fuenteBotonesEtiquetas);

        exerCodeField = new JComboBox<String>();
        exerCodeField.setFont(fuenteCampoTexto);

        olympCodeField = new JComboBox<>();
        olympCodeField.setFont(fuenteCampoTexto);

        itinerarioCodeField = new JComboBox<>();
        itinerarioCodeField.setFont(fuenteCampoTexto);

        exerCodeField = new JComboBox<>();
        exerCodeField.setFont(fuenteCampoTexto);

        ResultSet codes = administrador.selectCol("T_EJERCICIOS", "CODIGO");

        while (codes.next()) {
            String registro = codes.getString("CODIGO");
            exerCodeField.addItem(registro);
        }

        olympCodeField = new JComboBox<>();
        olympCodeField.setFont(fuenteCampoTexto);

        codes = administrador.selectCol("T_OLIMPIADAS", "CODIGO");

        while (codes.next()) {
            String registro = codes.getString("CODIGO");
            olympCodeField.addItem(registro);
        }

        itinerarioCodeField = new JComboBox<>();
        itinerarioCodeField.setFont(fuenteCampoTexto);

        String where = "WHERE OLIMPIADA='" + olympCodeField.getSelectedItem() + "'";
        codes = administrador.selectCol("T_ITINERARIOS", "CODIGO", where);

        while (codes.next()) {
            String registro = codes.getString("CODIGO");
            itinerarioCodeField.addItem(registro);
        }

        codes.close();

        assignExercise = new JButton("Asignar");
        assignExercise.setPreferredSize(new Dimension(100, 30));
        assignExercise.setFont(fuenteBotonesEtiquetas);

        JPanel createButtonPanel = new JPanel();
        createButtonPanel.setBorder(borde);
        createButtonPanel.add(assignExercise);

        inputPanel = new JPanel();
        inputPanel.setBorder(borde);
        inputPanel.setLayout(new GridLayout(3, 2, 10, 10));

        inputPanel.add(exerCode);
        inputPanel.add(exerCodeField);
        inputPanel.add(olympCode);
        inputPanel.add(olympCodeField);
        inputPanel.add(itinerarioCode);
        inputPanel.add(itinerarioCodeField);

        add(upperPanel, BorderLayout.NORTH);
        add(inputPanel, BorderLayout.CENTER);
        add(createButtonPanel, BorderLayout.SOUTH);

        goBackButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new VentanaAdministrador(administrador);
                dispose();
            }
        });

        olympCodeField.addActionListener(e -> {
            itinerarioCodeField.removeAllItems();

            try {
                String where1 = "WHERE OLIMPIADA='" + olympCodeField.getSelectedItem() + "'";
                ResultSet codes1 = administrador.selectCol("T_ITINERARIOS", "CODIGO", where1);

                while (codes1.next()) {
                    String registro = codes1.getString("CODIGO");
                    itinerarioCodeField.addItem(registro);

                }

                codes1.close();

            } catch (RuntimeException | SQLException ex) {
                new ErrorJOptionPane(ex.getMessage());

            }
        });

        assignExercise.addActionListener(e -> {
            if (itinerarioCodeField.getItemCount() == 0) {
                new ErrorJOptionPane("Debe seleccionar un itinerario");

            } else {
                String exercise = (String) exerCodeField.getSelectedItem();
                String olympiad = (String) olympCodeField.getSelectedItem();
                String itinerario = (String) itinerarioCodeField.getSelectedItem();

                if (administrador.assignExerciseToOlympiad(exercise, olympiad, itinerario) == 0) {
                    exerCodeField.setSelectedItem(exerCodeField.getItemAt(0));
                    olympCodeField.setSelectedItem(olympCodeField.getItemAt(0));
                    itinerarioCodeField.removeAllItems();

                }

            }
        });

    }

    public VentanaNuevaAsignacionEjOlimp(Administrador administrador) throws JSchException, SQLException {
        // Configuración de la ventana
        setSize(500, 290);
        getContentPane().setLayout(new BorderLayout(5, 5));
        this.setTitle("Nueva asignación");
        this.setVisible(true);
        setLocationRelativeTo(null);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        // Icono de la ventana
        setIconImage(iconoVentana);

        introduceData = new JLabel("Nueva asignación");
        introduceData.setFont(fuenteTitulo);

        goBackButton = new JButton("< Volver");
        goBackButton.setFont(fuenteBotonesEtiquetas);
        goBackButton.setPreferredSize(new Dimension(90, 30));

        upperPanel = new JPanel();
        upperPanel.setLayout(new BorderLayout(5, 5));
        upperPanel.add(introduceData, BorderLayout.CENTER);
        upperPanel.add(goBackButton, BorderLayout.EAST);
        upperPanel.setBorder(borde);

        exerCode = new JLabel("Ejercicio (*)");
        exerCode.setFont(fuenteBotonesEtiquetas);

        olympCode = new JLabel("Olimpiada (*)");
        olympCode.setFont(fuenteBotonesEtiquetas);

        itinerarioCode = new JLabel("Itinerario (*)");
        itinerarioCode.setFont(fuenteBotonesEtiquetas);

        exerCodeField = new JComboBox<String>();
        exerCodeField.setFont(fuenteCampoTexto);

        olympCodeField = new JComboBox<>();
        olympCodeField.setFont(fuenteCampoTexto);

        itinerarioCodeField = new JComboBox<>();
        itinerarioCodeField.setFont(fuenteCampoTexto);

        exerCodeField = new JComboBox<>();
        exerCodeField.setFont(fuenteCampoTexto);

        ResultSet codes = administrador.selectCol("T_EJERCICIOS", "CODIGO");

        while (codes.next()) {
            String registro = codes.getString("CODIGO");
            exerCodeField.addItem(registro);
        }

        olympCodeField = new JComboBox<>();
        olympCodeField.setFont(fuenteCampoTexto);

        codes = administrador.selectCol("T_OLIMPIADAS", "CODIGO");

        while (codes.next()) {
            String registro = codes.getString("CODIGO");
            olympCodeField.addItem(registro);
        }

        itinerarioCodeField = new JComboBox<>();
        itinerarioCodeField.setFont(fuenteCampoTexto);

        String where = "WHERE OLIMPIADA='" + olympCodeField.getSelectedItem() + "'";
        codes = administrador.selectCol("T_ITINERARIOS", "CODIGO", where);

        while (codes.next()) {
            String registro = codes.getString("CODIGO");
            itinerarioCodeField.addItem(registro);
        }

        codes.close();

        assignExercise = new JButton("Asignar");
        assignExercise.setPreferredSize(new Dimension(100, 30));
        assignExercise.setFont(fuenteBotonesEtiquetas);

        JPanel createButtonPanel = new JPanel();
        createButtonPanel.setBorder(borde);
        createButtonPanel.add(assignExercise);

        inputPanel = new JPanel();
        inputPanel.setBorder(borde);
        inputPanel.setLayout(new GridLayout(3, 2, 10, 10));

        inputPanel.add(exerCode);
        inputPanel.add(exerCodeField);
        inputPanel.add(olympCode);
        inputPanel.add(olympCodeField);
        inputPanel.add(itinerarioCode);
        inputPanel.add(itinerarioCodeField);

        add(upperPanel, BorderLayout.NORTH);
        add(inputPanel, BorderLayout.CENTER);
        add(createButtonPanel, BorderLayout.SOUTH);

        goBackButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new VentanaAdministrador(administrador);
                dispose();
            }
        });

        olympCodeField.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                itinerarioCodeField.removeAllItems();

                try {
                    String where = "WHERE OLIMPIADA='" + olympCodeField.getSelectedItem() + "'";
                    ResultSet codes = administrador.selectCol("T_ITINERARIOS", "CODIGO", where);

                    while (codes.next()) {
                        String registro = codes.getString("CODIGO");
                        itinerarioCodeField.addItem(registro);

                    }

                    codes.close();

                } catch (RuntimeException | SQLException ex) {
                    new CustomJOptionPane("ERROR - " + ex.getMessage());

                }
            }
        });

        assignExercise.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                if (itinerarioCodeField.getItemCount() == 0) {
                    new CustomJOptionPane("ERROR - Debe seleccionar un itinerario");

                } else {
                    String exercise = (String) exerCodeField.getSelectedItem();
                    String olympiad = (String) olympCodeField.getSelectedItem();
                    String itinerario = (String) itinerarioCodeField.getSelectedItem();

                    if (administrador.assignExerciseToOlympiad(exercise, olympiad, itinerario) == 0) {
                        exerCodeField.setSelectedItem(exerCodeField.getItemAt(0));
                        olympCodeField.setSelectedItem(olympCodeField.getItemAt(0));
                        itinerarioCodeField.removeAllItems();

                    }

                }
            }
        });

    }

Replace Anonymous With Lambda interfaz.administrador.VentanaNuevaAsignacionEjOlimp.VentanaNuevaAsignacionEjOlimp.addActionListener.new ActionListener with e -> {itinerarioCodeField.removeAllItems(); in method public VentanaNuevaAsignacionEjOlimp(administrador Administrador) from class interfaz.administrador.VentanaNuevaAsignacionEjOlimp


    public VentanaModificarAsignacionEjOlimp(Administrador administrador, String ejercicio, String olimpiada, String itinerario) throws JSchException, SQLException {
        // Configuración de la ventana
        setSize(500, 290);
        getContentPane().setLayout(new BorderLayout(5, 5));
        this.setTitle("Modificar asignación");
        this.setVisible(true);
        setLocationRelativeTo(null);
        setIconImage(iconoVentana);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        String oldExercise = ejercicio;
        String oldOlympiad = olimpiada;
        String oldItinerario = itinerario;

        introduceData = new JLabel("Modificar asignación");
        introduceData.setFont(fuenteTitulo);

        goBackButton = new JButton("< Volver");
        goBackButton.setFont(fuenteBotonesEtiquetas);
        goBackButton.setPreferredSize(new Dimension(90, 30));

        upperPanel = new JPanel();
        upperPanel.setLayout(new BorderLayout(5, 5));
        upperPanel.add(introduceData, BorderLayout.CENTER);
        upperPanel.add(goBackButton, BorderLayout.EAST);
        upperPanel.setBorder(borde);

        exerCode = new JLabel("Ejercicio (*)");
        exerCode.setFont(fuenteBotonesEtiquetas);

        olympCode = new JLabel("Olimpiada (*)");
        olympCode.setFont(fuenteBotonesEtiquetas);

        itinerarioCode = new JLabel("Itinerario (*)");
        itinerarioCode.setFont(fuenteBotonesEtiquetas);

        exerCodeField = new JComboBox<String>();
        exerCodeField.setFont(fuenteCampoTexto);

        olympCodeField = new JComboBox<>();
        olympCodeField.setFont(fuenteCampoTexto);

        itinerarioCodeField = new JComboBox<>();
        itinerarioCodeField.setFont(fuenteCampoTexto);

        exerCodeField = new JComboBox<>();
        exerCodeField.setFont(fuenteCampoTexto);

        ResultSet codes = administrador.selectCol("T_EJERCICIOS", "CODIGO", "");

         // Iterar sobre el resultado y añadir los registros al ArrayList
        while (codes.next()) {
            String registro = codes.getString("CODIGO");
            exerCodeField.addItem(registro);
        }

        exerCodeField.setSelectedItem(ejercicio);

        olympCodeField = new JComboBox<>();
        olympCodeField.setFont(fuenteCampoTexto);

        codes = administrador.selectCol("T_OLIMPIADAS", "CODIGO", "");

        // Iterar sobre el resultado y añadir los registros al ArrayList
        while (codes.next()) {
            String registro = codes.getString("CODIGO");
            olympCodeField.addItem(registro);
        }

        olympCodeField.setSelectedItem(olimpiada);

        itinerarioCodeField = new JComboBox<>();
        itinerarioCodeField.setFont(fuenteCampoTexto);

        String where = "WHERE OLIMPIADA='" + olympCodeField.getSelectedItem() + "'";
        codes = administrador.selectCol("T_ITINERARIOS", "CODIGO", where);

        // Iterar sobre el resultado y añadir los registros al ArrayList
        while (codes.next()) {
            String registro = codes.getString("CODIGO");
            itinerarioCodeField.addItem(registro);
        }

        itinerarioCodeField.setSelectedItem(itinerario);

        codes.close();

        assignExercise = new JButton("Modificar asignación");
        assignExercise.setPreferredSize(new Dimension(175, 30));
        assignExercise.setFont(fuenteBotonesEtiquetas);

        JPanel createButtonPanel = new JPanel();
        createButtonPanel.setBorder(borde);
        createButtonPanel.add(assignExercise);

        inputPanel = new JPanel();
        inputPanel.setBorder(borde);
        inputPanel.setLayout(new GridLayout(3, 2, 10, 10));

        inputPanel.add(exerCode);
        inputPanel.add(exerCodeField);
        inputPanel.add(olympCode);
        inputPanel.add(olympCodeField);
        inputPanel.add(itinerarioCode);
        inputPanel.add(itinerarioCodeField);

        add(upperPanel, BorderLayout.NORTH);
        add(inputPanel, BorderLayout.CENTER);
        add(createButtonPanel, BorderLayout.SOUTH);

        goBackButton.addActionListener(e -> {
            try {
                new VentanaConsultaAsignacionEjOlimp(administrador);
                dispose();

            } catch (JSchException | SQLException ex) {
                throw new RuntimeException(ex);

            }
        });

        olympCodeField.addActionListener(e -> {
            itinerarioCodeField.removeAllItems();

            try {
                String where1 = "WHERE OLIMPIADA='" + olympCodeField.getSelectedItem() + "'";
                ResultSet codes1 = administrador.selectCol("T_ITINERARIOS", "CODIGO", where1);

                while (codes1.next()) {
                    String registro = codes1.getString("CODIGO");
                    itinerarioCodeField.addItem(registro);

                }

                codes1.close();

            } catch (RuntimeException | SQLException ex) {
                new CustomJOptionPane("ERROR - " + ex.getMessage());

            }
        });

        assignExercise.addActionListener(e -> {
            if (itinerarioCodeField.getItemCount() == 0) {
                new CustomJOptionPane("ERROR - Debe seleccionar un itinerario");

            } else {
                String exercise = (String) exerCodeField.getSelectedItem();
                String olympiad = (String) olympCodeField.getSelectedItem();
                String itinerary = (String) itinerarioCodeField.getSelectedItem();

                try {
                    if (administrador.modifyAssignationExOlymp(oldExercise, oldOlympiad, oldItinerario, exercise, olympiad, itinerary) == 0) {
                        new VentanaConsultaAsignacionEjOlimp(administrador);
                        dispose();
                    }

                } catch (JSchException | SQLException ex) {
                    new CustomJOptionPane("ERROR - " + ex.getMessage());

                }
            }
        });

    }

    public VentanaModificarAsignacionEjOlimp(Administrador administrador, String ejercicio, String olimpiada, String itinerario) throws JSchException, SQLException {
        // Configuración de la ventana
        setSize(500, 290);
        getContentPane().setLayout(new BorderLayout(5, 5));
        this.setTitle("Modificar asignación");
        this.setVisible(true);
        setLocationRelativeTo(null);
        setIconImage(iconoVentana);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        String oldExercise = ejercicio;
        String oldOlympiad = olimpiada;
        String oldItinerario = itinerario;

        introduceData = new JLabel("Modificar asignación");
        introduceData.setFont(fuenteTitulo);

        goBackButton = new JButton("< Volver");
        goBackButton.setFont(fuenteBotonesEtiquetas);
        goBackButton.setPreferredSize(new Dimension(90, 30));

        upperPanel = new JPanel();
        upperPanel.setLayout(new BorderLayout(5, 5));
        upperPanel.add(introduceData, BorderLayout.CENTER);
        upperPanel.add(goBackButton, BorderLayout.EAST);
        upperPanel.setBorder(borde);

        exerCode = new JLabel("Ejercicio (*)");
        exerCode.setFont(fuenteBotonesEtiquetas);

        olympCode = new JLabel("Olimpiada (*)");
        olympCode.setFont(fuenteBotonesEtiquetas);

        itinerarioCode = new JLabel("Itinerario (*)");
        itinerarioCode.setFont(fuenteBotonesEtiquetas);

        exerCodeField = new JComboBox<String>();
        exerCodeField.setFont(fuenteCampoTexto);

        olympCodeField = new JComboBox<>();
        olympCodeField.setFont(fuenteCampoTexto);

        itinerarioCodeField = new JComboBox<>();
        itinerarioCodeField.setFont(fuenteCampoTexto);

        exerCodeField = new JComboBox<>();
        exerCodeField.setFont(fuenteCampoTexto);

        ResultSet codes = administrador.selectCol("T_EJERCICIOS", "CODIGO", "");

         // Iterar sobre el resultado y añadir los registros al ArrayList
        while (codes.next()) {
            String registro = codes.getString("CODIGO");
            exerCodeField.addItem(registro);
        }

        exerCodeField.setSelectedItem(ejercicio);

        olympCodeField = new JComboBox<>();
        olympCodeField.setFont(fuenteCampoTexto);

        codes = administrador.selectCol("T_OLIMPIADAS", "CODIGO", "");

        // Iterar sobre el resultado y añadir los registros al ArrayList
        while (codes.next()) {
            String registro = codes.getString("CODIGO");
            olympCodeField.addItem(registro);
        }

        olympCodeField.setSelectedItem(olimpiada);

        itinerarioCodeField = new JComboBox<>();
        itinerarioCodeField.setFont(fuenteCampoTexto);

        String where = "WHERE OLIMPIADA='" + olympCodeField.getSelectedItem() + "'";
        codes = administrador.selectCol("T_ITINERARIOS", "CODIGO", where);

        // Iterar sobre el resultado y añadir los registros al ArrayList
        while (codes.next()) {
            String registro = codes.getString("CODIGO");
            itinerarioCodeField.addItem(registro);
        }

        itinerarioCodeField.setSelectedItem(itinerario);

        codes.close();

        assignExercise = new JButton("Modificar asignación");
        assignExercise.setPreferredSize(new Dimension(175, 30));
        assignExercise.setFont(fuenteBotonesEtiquetas);

        JPanel createButtonPanel = new JPanel();
        createButtonPanel.setBorder(borde);
        createButtonPanel.add(assignExercise);

        inputPanel = new JPanel();
        inputPanel.setBorder(borde);
        inputPanel.setLayout(new GridLayout(3, 2, 10, 10));

        inputPanel.add(exerCode);
        inputPanel.add(exerCodeField);
        inputPanel.add(olympCode);
        inputPanel.add(olympCodeField);
        inputPanel.add(itinerarioCode);
        inputPanel.add(itinerarioCodeField);

        add(upperPanel, BorderLayout.NORTH);
        add(inputPanel, BorderLayout.CENTER);
        add(createButtonPanel, BorderLayout.SOUTH);

        goBackButton.addActionListener(e -> {
            try {
                new VentanaConsultaAsignacionEjOlimp(administrador);
                dispose();

            } catch (JSchException | SQLException ex) {
                throw new RuntimeException(ex);

            }
        });

        olympCodeField.addActionListener(e -> {
            itinerarioCodeField.removeAllItems();

            try {
                String where1 = "WHERE OLIMPIADA='" + olympCodeField.getSelectedItem() + "'";
                ResultSet codes1 = administrador.selectCol("T_ITINERARIOS", "CODIGO", where1);

                while (codes1.next()) {
                    String registro = codes1.getString("CODIGO");
                    itinerarioCodeField.addItem(registro);

                }

                codes1.close();

            } catch (RuntimeException | SQLException ex) {
                new CustomJOptionPane("ERROR - " + ex.getMessage());

            }
        });

        assignExercise.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                if (itinerarioCodeField.getItemCount() == 0) {
                    new CustomJOptionPane("ERROR - Debe seleccionar un itinerario");

                } else {
                    String exercise = (String) exerCodeField.getSelectedItem();
                    String olympiad = (String) olympCodeField.getSelectedItem();
                    String itinerary = (String) itinerarioCodeField.getSelectedItem();

                    try {
                        if (administrador.modifyAssignationExOlymp(oldExercise, oldOlympiad, oldItinerario, exercise, olympiad, itinerary) == 0) {
                            new VentanaConsultaAsignacionEjOlimp(administrador);
                            dispose();
                        }

                    } catch (JSchException | SQLException ex) {
                        new CustomJOptionPane("ERROR - " + ex.getMessage());

                    }
                }
            }
        });

    }

Replace Anonymous With Lambda interfaz.administrador.VentanaModificarAsignacionEjOlimp.VentanaModificarAsignacionEjOlimp.addActionListener.new ActionListener with e -> {if(itinerarioCodeField.getItemCount() == 0){new CustomJOptionPane("ERROR - Debe seleccionar un itinerario"); in method public VentanaModificarAsignacionEjOlimp(administrador Administrador, ejercicio String, olimpiada String, itinerario String) from class interfaz.administrador.VentanaModificarAsignacionEjOlimp