default Optional<Item> remove(int slot,int amount){
  Optional<Item> o=get(slot);
  if (o.isPresent()) {
    Item item=o.get();
    item.setCount(item.count() - amount);
    if (item.count() <= 0) {
      remove(slot);
    }
    return Optional.of(item.withAmount(amount));
  }
  return Optional.empty();
}

default Optional < Item > remove ( int slot , int amount ) { Optional < Item > o = get ( slot ) ; if ( o . isPresent ( ) ) { Item item = o . get ( ) ; item . setCount ( item . count ( ) - amount ) ; if ( item . count ( ) <= 0 ) { remove ( slot ) ; } return Optional . of ( item . withAmount ( amount ) ) ; } return Optional . empty ( ) ; }
removes a certain amount of items from a slot .
