code: static void validateFactoryAndClass(FieldDefinition fd, int factoryId, int classId, String fullPath) {
          if (factoryId != fd.getFactoryId()) {
              throw new IllegalArgumentException("Invalid factoryId! Expected: "
                      + fd.getFactoryId() + ", Current: " + factoryId + " in path " + fullPath);
          }
          if (classId != fd.getClassId()) {
              throw new IllegalArgumentException("Invalid classId! Expected: "
                      + fd.getClassId() + ", Current: " + classId + " in path " + fullPath);
          }
      }
docs: Validates if the given factoryId and classId match the ones from the fieldDefinition
  
  @param fd        given fieldDefinition to validate against
  @param factoryId given factoryId to validate
  @param classId   given factoryId to validate
  @param fullPath  full path - just for output