// Path: src/main/java/sleet/SleetException.java
// public class SleetException extends Exception {
// 
//   /**
//    * generated by eclipse
//    */
//   private static final long serialVersionUID = -404982431470350032L;
// 
//   public SleetException(String message, Throwable cause) {
//     super(message, cause);
//   }
// 
//   public SleetException(String message) {
//     super(message);
//   }
// 
//   public SleetException(Throwable cause) {
//     super(cause);
//   }
// 
// }
// 
// Path: src/main/java/sleet/generators/GeneratorConfigException.java
// public class GeneratorConfigException extends GeneratorException {
//   /**
//    * generated by eclipse
//    */
//   private static final long serialVersionUID = -2894157024668803650L;
// 
//   public GeneratorConfigException(String message, Throwable cause) {
//     super(message, cause);
//   }
// 
//   public GeneratorConfigException(String message) {
//     super(message);
//   }
// 
//   public GeneratorConfigException(Throwable cause) {
//     super(cause);
//   }
// 
// }
// 
// Path: src/main/java/sleet/generators/GeneratorSessionException.java
// public class GeneratorSessionException extends GeneratorException {
//   /**
//    * generated by eclipse
//    */
// 
//   private static final long serialVersionUID = -5663201042060915360L;
// 
//   public GeneratorSessionException(String message, Throwable cause) {
//     super(message, cause);
//   }
// 
//   public GeneratorSessionException(String message) {
//     super(message);
//   }
// 
//   public GeneratorSessionException(Throwable cause) {
//     super(cause);
//   }
// 
// }
// 
// Path: src/main/java/sleet/generators/IdGenerator.java
// public interface IdGenerator<T extends IdType<?, ?>> {
//   public void beginIdSession(Properties config) throws SleetException;
// 
//   public void checkSessionValidity() throws SleetException;
// 
//   public void endIdSession() throws SleetException;
// 
//   public IdType<?, ?> getId(List<IdState<?, ?>> states) throws SleetException;
// }
// 
// Path: src/main/java/sleet/id/LongId.java
// public class LongId implements LongIdType {
//   private final long value;
//   private final int numBits;
//   private final IdError error;
// 
//   public LongId(long value, IdError error, int numBits) {
//     this.value = value;
//     this.error = error;
//     this.numBits = numBits;
//   }
// 
//   @Override
//   public Long getId() {
//     return this.value;
//   }
// 
//   @Override
//   public IdError getError() {
//     return this.error;
//   }
// 
//   @Override
//   public int getNumBitsInId() {
//     return this.numBits;
//   }
// 
// }
// 
// Path: src/main/java/sleet/id/LongIdType.java
// public interface LongIdType extends IdType<Long, IdError> {
// 
// }
// 
// Path: src/main/java/sleet/state/IdState.java
// public class IdState<T, E extends IdError> {
//   private Class<? extends IdGenerator<? extends IdType<T, E>>> generatorClass;
//   private IdType<T, E> id;
// 
//   public IdState(Class<? extends IdGenerator<? extends IdType<T, E>>> generatorClass, IdType<T, E> id) {
//     this.generatorClass = generatorClass;
//     this.id = id;
//   }
// 
//   public Class<? extends IdGenerator<? extends IdType<T, E>>> getGeneratorClass() {
//     return generatorClass;
//   }
// 
//   public IdType<T, E> getId() {
//     return id;
//   }
// }


import java.util.List;
import java.util.Properties;
import sleet.SleetException;
import sleet.generators.GeneratorConfigException;
import sleet.generators.GeneratorSessionException;
import sleet.generators.IdGenerator;
import sleet.id.LongId;
import sleet.id.LongIdType;
import sleet.state.IdState;
    String bitsStr = config.getProperty(FIXED_BITS_IN_ID_KEY);
    if (bitsStr == null) {
      throw new GeneratorConfigException("Missing number of bits for the fixed value, must be specified in configuration properties key \"" + FIXED_BITS_IN_ID_KEY + "\".");
    }
    int bits = -1;
    try {
      bits = Integer.valueOf(bitsStr);
    } catch (NumberFormatException e) {
      throw new GeneratorConfigException("Failed to parse number of bits from value \"" + bitsStr + "\".  The value for configuration properties key \"" + FIXED_BITS_IN_ID_KEY + "\" must be a long.");
    }

    if ((1L << bits) - 1L < value) {
      throw new GeneratorConfigException("Specified value of " + value + " exceeds the capacity of the number of bits specified (" + bits + ").");
    }

    this.value = new LongId(value, null, bits);
  }

  @Override
  public void checkSessionValidity() throws SleetException {
    validateSessionStarted();
  }

  @Override
  public void endIdSession() throws SleetException {
    validateSessionStarted();
    this.value = null;
  }

  @Override
// Path: src/main/java/sleet/SleetException.java
// public class SleetException extends Exception {
// 
//   /**
//    * generated by eclipse
//    */
//   private static final long serialVersionUID = -404982431470350032L;
// 
//   public SleetException(String message, Throwable cause) {
//     super(message, cause);
//   }
// 
//   public SleetException(String message) {
//     super(message);
//   }
// 
//   public SleetException(Throwable cause) {
//     super(cause);
//   }
// 
// }
// 
// Path: src/main/java/sleet/generators/GeneratorConfigException.java
// public class GeneratorConfigException extends GeneratorException {
//   /**
//    * generated by eclipse
//    */
//   private static final long serialVersionUID = -2894157024668803650L;
// 
//   public GeneratorConfigException(String message, Throwable cause) {
//     super(message, cause);
//   }
// 
//   public GeneratorConfigException(String message) {
//     super(message);
//   }
// 
//   public GeneratorConfigException(Throwable cause) {
//     super(cause);
//   }
// 
// }
// 
// Path: src/main/java/sleet/generators/GeneratorSessionException.java
// public class GeneratorSessionException extends GeneratorException {
//   /**
//    * generated by eclipse
//    */
// 
//   private static final long serialVersionUID = -5663201042060915360L;
// 
//   public GeneratorSessionException(String message, Throwable cause) {
//     super(message, cause);
//   }
// 
//   public GeneratorSessionException(String message) {
//     super(message);
//   }
// 
//   public GeneratorSessionException(Throwable cause) {
//     super(cause);
//   }
// 
// }
// 
// Path: src/main/java/sleet/generators/IdGenerator.java
// public interface IdGenerator<T extends IdType<?, ?>> {
//   public void beginIdSession(Properties config) throws SleetException;
// 
//   public void checkSessionValidity() throws SleetException;
// 
//   public void endIdSession() throws SleetException;
// 
//   public IdType<?, ?> getId(List<IdState<?, ?>> states) throws SleetException;
// }
// 
// Path: src/main/java/sleet/id/LongId.java
// public class LongId implements LongIdType {
//   private final long value;
//   private final int numBits;
//   private final IdError error;
// 
//   public LongId(long value, IdError error, int numBits) {
//     this.value = value;
//     this.error = error;
//     this.numBits = numBits;
//   }
// 
//   @Override
//   public Long getId() {
//     return this.value;
//   }
// 
//   @Override
//   public IdError getError() {
//     return this.error;
//   }
// 
//   @Override
//   public int getNumBitsInId() {
//     return this.numBits;
//   }
// 
// }
// 
// Path: src/main/java/sleet/id/LongIdType.java
// public interface LongIdType extends IdType<Long, IdError> {
// 
// }
// 
// Path: src/main/java/sleet/state/IdState.java
// public class IdState<T, E extends IdError> {
//   private Class<? extends IdGenerator<? extends IdType<T, E>>> generatorClass;
//   private IdType<T, E> id;
// 
//   public IdState(Class<? extends IdGenerator<? extends IdType<T, E>>> generatorClass, IdType<T, E> id) {
//     this.generatorClass = generatorClass;
//     this.id = id;
//   }
// 
//   public Class<? extends IdGenerator<? extends IdType<T, E>>> getGeneratorClass() {
//     return generatorClass;
//   }
// 
//   public IdType<T, E> getId() {
//     return id;
//   }
// }


// Path: src/main/java/sleet/generators/fixed/FixedLongIdGenerator.java
import java.util.List;
import java.util.Properties;
import sleet.SleetException;
import sleet.generators.GeneratorConfigException;
import sleet.generators.GeneratorSessionException;
import sleet.generators.IdGenerator;
import sleet.id.LongId;
import sleet.id.LongIdType;
import sleet.state.IdState;

    String bitsStr = config.getProperty(FIXED_BITS_IN_ID_KEY);
    if (bitsStr == null) {
      throw new GeneratorConfigException("Missing number of bits for the fixed value, must be specified in configuration properties key \"" + FIXED_BITS_IN_ID_KEY + "\".");
    }
    int bits = -1;
    try {
      bits = Integer.valueOf(bitsStr);
    } catch (NumberFormatException e) {
      throw new GeneratorConfigException("Failed to parse number of bits from value \"" + bitsStr + "\".  The value for configuration properties key \"" + FIXED_BITS_IN_ID_KEY + "\" must be a long.");
    }

    if ((1L << bits) - 1L < value) {
      throw new GeneratorConfigException("Specified value of " + value + " exceeds the capacity of the number of bits specified (" + bits + ").");
    }

    this.value = new LongId(value, null, bits);
  }

  @Override
  public void checkSessionValidity() throws SleetException {
    validateSessionStarted();
  }

  @Override
  public void endIdSession() throws SleetException {
    validateSessionStarted();
    this.value = null;
  }

  @Override
  public LongIdType getId(List<IdState<?, ?>> states) throws SleetException {