code: private static int getYearInCycle(int cycleNumber, long dayOfCycle) {
          Integer[] cycles = getAdjustedCycle(cycleNumber);
          if (dayOfCycle == 0) {
              return 0;
          }
  
          if (dayOfCycle > 0) {
              for (int i = 0; i < cycles.length; i++) {
                  if (dayOfCycle < cycles[i].intValue()) {
                      return i - 1;
                  }
              }
              return 29;
          } else {
              dayOfCycle = -dayOfCycle;
              for (int i = 0; i < cycles.length; i++) {
                  if (dayOfCycle <= cycles[i].intValue()) {
                      return i - 1;
                  }
              }
              return 29;
          }
      }
docs: Returns the year in cycle from the cycle number and day of cycle.
  
  @param cycleNumber  a cycle number
  @param dayOfCycle  day of cycle
  @return a year in cycle