// Path: myeslib-core/src/main/java/org/myeslib/core/AggregateRoot.java
// public interface AggregateRoot extends Serializable {
// 
// }
// 
// Path: myeslib-core/src/main/java/org/myeslib/core/Command.java
// public interface Command extends Serializable {
// 	
//     UUID getCommandId();
// 	Long getTargetVersion();
// 	
// }
// 
// Path: myeslib-core/src/main/java/org/myeslib/core/CommandHandler.java
// public interface CommandHandler<C extends Command> {
//     
//     List<? extends Event> handle(C command);
// 
// }
// 
// Path: myeslib-core/src/main/java/org/myeslib/core/Event.java
// public interface Event extends Serializable {
// 	
// }


import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Delegate;
import lombok.NonNull;
import lombok.Value;
import org.myeslib.core.AggregateRoot;
import org.myeslib.core.Command;
import org.myeslib.core.CommandHandler;
import org.myeslib.core.Event;
import com.google.common.base.Function;
            checkArgument(getId().equals(command.getId()), "item id does not match");
            checkArgument(isAvailable(command.howMany), "there are not enough items available");
            InventoryDecreased event = new InventoryDecreased(command.getId(), command.getHowMany());
            return Arrays.asList(event);
        }
    }
    
    // commands

    @Value
    public static class CreateInventoryItem implements Command {
        @NonNull
        UUID commandId;
        @NonNull
        UUID id;
        Long targetVersion = 0L;
    }

    @Value
    public static class IncreaseInventory implements Command {
        @NonNull
        UUID commandId;
        @NonNull
        UUID id;
        @NonNull
        Integer howMany;
        Long targetVersion;
    }

    @Value
// Path: myeslib-core/src/main/java/org/myeslib/core/AggregateRoot.java
// public interface AggregateRoot extends Serializable {
// 
// }
// 
// Path: myeslib-core/src/main/java/org/myeslib/core/Command.java
// public interface Command extends Serializable {
// 	
//     UUID getCommandId();
// 	Long getTargetVersion();
// 	
// }
// 
// Path: myeslib-core/src/main/java/org/myeslib/core/CommandHandler.java
// public interface CommandHandler<C extends Command> {
//     
//     List<? extends Event> handle(C command);
// 
// }
// 
// Path: myeslib-core/src/main/java/org/myeslib/core/Event.java
// public interface Event extends Serializable {
// 	
// }


// Path: inventory-aggregate-root/src/main/java/org/myeslib/example/SampleDomain.java
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Delegate;
import lombok.NonNull;
import lombok.Value;
import org.myeslib.core.AggregateRoot;
import org.myeslib.core.Command;
import org.myeslib.core.CommandHandler;
import org.myeslib.core.Event;
import com.google.common.base.Function;

            checkArgument(getId().equals(command.getId()), "item id does not match");
            checkArgument(isAvailable(command.howMany), "there are not enough items available");
            InventoryDecreased event = new InventoryDecreased(command.getId(), command.getHowMany());
            return Arrays.asList(event);
        }
    }
    
    // commands

    @Value
    public static class CreateInventoryItem implements Command {
        @NonNull
        UUID commandId;
        @NonNull
        UUID id;
        Long targetVersion = 0L;
    }

    @Value
    public static class IncreaseInventory implements Command {
        @NonNull
        UUID commandId;
        @NonNull
        UUID id;
        @NonNull
        Integer howMany;
        Long targetVersion;
    }

    @Value
    public static class DecreaseInventory implements Command {