code: public static int getDayOfWeek(
          int year,
          int month,
          int dayOfMonth
      ) {
  
          if ((dayOfMonth < 1) || (dayOfMonth > 31)) {
              throw new IllegalArgumentException(
                  "Day out of range: " + dayOfMonth);
          } else if (dayOfMonth > getLengthOfMonth(year, month)) {
              throw new IllegalArgumentException(
                  "Day exceeds month length: "
                  + toString(year, month, dayOfMonth));
          }
  
          int m = gaussianWeekTerm(month);
          int y = (year % 100);
          int c = Math.floorDiv(year, 100);
  
          if (y < 0) {
              y += 100;
          }
  
          if (month <= 2) { // Januar oder Februar
              y--;
              if (y < 0) {
                  y = 99;
                  c--;
              }
          }
  
          // Gauß'sche Wochentagsformel
          int k = Math.floorDiv(c, 4);
          int w = ((dayOfMonth + m + y + (y / 4) + k - 2 * c) % 7);
  
          if (w <= 0) {
              w += 7;
          }
  
          return w;
  
      }
docs: /*[deutsch]
  <p>Liefert den Tag des Woche f&uuml;r das angegebene Datum. </p>
  
  <p>Diese Methode setzt gem&auml;&szlig; dem ISO-8601-Standard den
  Montag als ersten Tag der Woche voraus. </p>
  
  @param   year        proleptic iso year
  @param   month       gregorian month (1-12)
  @param   dayOfMonth  day of month (1-31)
  @return  day of week (monday = 1, ..., sunday = 7)
  @throws  IllegalArgumentException if the month or the day are
  out of range