code: static NewYearStrategy readFromStream(DataInput in) throws IOException {
  
          int n = in.readInt();
  
          if (n == 0) {
              NewYearRule rule = NewYearRule.valueOf(in.readUTF());
              int annoDomini = in.readInt();
  
              if ((annoDomini == Integer.MAX_VALUE) && (rule == NewYearRule.BEGIN_OF_JANUARY)) {
                  return NewYearStrategy.DEFAULT;
              } else {
                  return new NewYearStrategy(rule, annoDomini);
              }
          }
  
          List<NewYearStrategy> strategies = new ArrayList<>(n);
  
          for (int i = 0; i < n; i++) {
              NewYearRule rule = NewYearRule.valueOf(in.readUTF());
              int annoDomini = in.readInt();
              strategies.add(new NewYearStrategy(rule, annoDomini));
          }
  
          return new NewYearStrategy(strategies);
  
      }
docs: used in deserialization