code: @Override
      public boolean encode(long[] current, long[] next) {
  
          int p = permutation.parity(current);
  
          // if is a permutation parity (all neighbors are different)
          if (p != 0) {
  
              // multiple with the geometric parity
              int q = geometric.parity() * p;
  
              // configure anticlockwise/clockwise
              if (q > 0) {
                  for (int i : centres) {
                      next[i] = current[i] * ANTICLOCKWISE;
                  }
              } else if (q < 0) {
                  for (int i : centres) {
                      next[i] = current[i] * CLOCKWISE;
                  }
              }
  
              // 0 parity ignored
  
              return true;
          }
          return false;
      }
docs: Encodes the {@code centres[]} specified in the constructor as either
  clockwise/anticlockwise or none. If there is a permutation parity but no
  geometric parity then we can not encode the configuration and 'true' is
  returned to indicate the perception is done. If there is no permutation
  parity this may changed with the next {@code current[]} values and so
  'false' is returned.
  
  {@inheritDoc}