gt:         if (container == null)
context: 
  package net.minecraftforge.fluids;
  
  import java.util.Map;
  import java.util.Set;
  
  import com.google.common.collect.Maps;
  import com.google.common.collect.Sets;
  
  import net.minecraftforge.fml.common.FMLLog;
  import net.minecraftforge.fml.common.eventhandler.Event;
  import net.minecraft.init.Items;
  import net.minecraft.item.ItemStack;
  import net.minecraftforge.common.MinecraftForge;
  
  /**
   * Register simple items that contain fluids here. Useful for buckets, bottles, and things that have
   * ID/metadata mappings.
   *
   * For more complex items, use {@link IFluidContainerItem} instead.
   *
   * Deprecated: We will eventually be moving this ALL away from a registry and instead EVERYTHING will use IFluidContainerItem.
   * We need to decide a way of swapping Items/Stacks.
   */
  @Deprecated
  public abstract class FluidContainerRegistry
  {
      // Holder object that implements HashCode for an ItemStack,
      // the local maps are not guaranteed to have the same internal generic structure,
      // but the external interface for checking ItemStacks will still exist.
      private static class ContainerKey
      {
          ItemStack container;
          FluidStack fluid;
          private ContainerKey(ItemStack container)
          {
              this.container = container;
          }
          private ContainerKey(ItemStack container, FluidStack fluid)
          {
              this(container);
              this.fluid = fluid;
          }
          @Override
          public int hashCode()
          {
              int code = 1;
              code = 31*code + container.getItem().hashCode();
              code = 31*code + container.getItemDamage();
              if (fluid != null)
                  code = 31*code + fluid.getFluid().hashCode();
              return code;
          }
          @Override
          public boolean equals(Object o)
          {
              if (!(o instanceof ContainerKey)) return false;
              ContainerKey ck = (ContainerKey)o;
              if (container.getItem() != ck.container.getItem()) return false;
              if (container.getItemDamage() != ck.container.getItemDamage()) return false;
              if (fluid == null && ck.fluid != null) return false;
              if (fluid != null && ck.fluid == null) return false;
              if (fluid == null && ck.fluid == null) return true;
              if (fluid.getFluid() != ck.fluid.getFluid()) return false;
              return true;
          }
      }
  
      private static Map<ContainerKey, FluidContainerData> containerFluidMap = Maps.newHashMap();
      private static Map<ContainerKey, FluidContainerData> filledContainerMap = Maps.newHashMap();
      private static Set<ContainerKey> emptyContainers = Sets.newHashSet();
  
      public static final int BUCKET_VOLUME = 1000;
      public static final ItemStack EMPTY_BUCKET = new ItemStack(Items.BUCKET);
      public static final ItemStack EMPTY_BOTTLE = new ItemStack(Items.GLASS_BOTTLE);
      private static final ItemStack NULL_EMPTYCONTAINER = new ItemStack(Items.BUCKET);
  
      static
      {
          registerFluidContainer(FluidRegistry.WATER, new ItemStack(Items.WATER_BUCKET), EMPTY_BUCKET);
          registerFluidContainer(FluidRegistry.LAVA,  new ItemStack(Items.LAVA_BUCKET),  EMPTY_BUCKET);
          registerFluidContainer(FluidRegistry.WATER, new ItemStack(Items.POTIONITEM),   EMPTY_BOTTLE);
      }
  
      private FluidContainerRegistry(){}
  
      /**
       * Register a new fluid containing item.
       *
       * @param stack
       *            FluidStack containing the type and amount of the fluid stored in the item.
       * @param filledContainer
       *            ItemStack representing the container when it is full.
       * @param emptyContainer
       *            ItemStack representing the container when it is empty.
       * @return True if container was successfully registered; false if it already is.
       */
      public static boolean registerFluidContainer(FluidStack stack, ItemStack filledContainer, ItemStack emptyContainer)
      {
          return registerFluidContainer(new FluidContainerData(stack, filledContainer, emptyContainer));
      }
  
      /**
       * Register a new fluid containing item. The item is assumed to hold 1000 mB of fluid. Also
       * registers the Fluid if possible.
       *
       * @param fluid
       *            Fluid type that is stored in the item.
       * @param filledContainer
       *            ItemStack representing the container when it is full.
       * @param emptyContainer
       *            ItemStack representing the container when it is empty.
       * @return True if container was successfully registered; false if it already is.
       */
      public static boolean registerFluidContainer(Fluid fluid, ItemStack filledContainer, ItemStack emptyContainer)
      {
          if (!FluidRegistry.isFluidRegistered(fluid))
          {
              FluidRegistry.registerFluid(fluid);
          }
          return registerFluidContainer(new FluidStack(fluid, BUCKET_VOLUME), filledContainer, emptyContainer);
      }
  
      /**
       * Register a new fluid containing item that does not have an empty container.
       *
       * @param stack
       *            FluidStack containing the type and amount of the fluid stored in the item.
       * @param filledContainer
       *            ItemStack representing the container when it is full.
       * @return True if container was successfully registered; false if it already is, or an invalid parameter was passed.
       */
      public static boolean registerFluidContainer(FluidStack stack, ItemStack filledContainer)
      {
          return registerFluidContainer(new FluidContainerData(stack, filledContainer, null, true));
      }
  
      /**
       * Register a new fluid containing item that does not have an empty container. The item is
       * assumed to hold 1000 mB of fluid. Also registers the Fluid if possible.
       *
       * @param fluid
       *            Fluid type that is stored in the item.
       * @param filledContainer
       *            ItemStack representing the container when it is full.
       * @return True if container was successfully registered; false if it already is, or an invalid parameter was passed.
       */
      public static boolean registerFluidContainer(Fluid fluid, ItemStack filledContainer)
      {
          if (!FluidRegistry.isFluidRegistered(fluid))
          {
              FluidRegistry.registerFluid(fluid);
          }
          return registerFluidContainer(new FluidStack(fluid, BUCKET_VOLUME), filledContainer);
      }
  
      /**
       * Register a new fluid containing item.
       *
       * @param data
       *            See {@link FluidContainerData}.
       * @return True if container was successfully registered; false if it already is, or an invalid parameter was passed.
       */
      public static boolean registerFluidContainer(FluidContainerData data)
      {
          if (isFilledContainer(data.filledContainer) || data.filledContainer == null)
          {
              return false;
          }
          if (data.fluid == null || data.fluid.getFluid() == null)
          {
              FMLLog.bigWarning("Invalid registration attempt for a fluid container item %s has occurred. The registration has been denied to prevent crashes. The mod responsible for the registration needs to correct this.", data.filledContainer.getItem().getUnlocalizedName(data.filledContainer));
              return false;
          }
          containerFluidMap.put(new ContainerKey(data.filledContainer), data);
  
          if (data.emptyContainer != null && data.emptyContainer != NULL_EMPTYCONTAINER)
          {
              filledContainerMap.put(new ContainerKey(data.emptyContainer, data.fluid), data);
              emptyContainers.add(new ContainerKey(data.emptyContainer));
          }
  
          MinecraftForge.EVENT_BUS.post(new FluidContainerRegisterEvent(data));
          return true;
      }
  
      /**
       * Determines the fluid type and amount inside a container.
       *
       * @param container
       *            The fluid container.
       * @return FluidStack representing stored fluid.
       */
      public static FluidStack getFluidForFilledItem(ItemStack container)
      {
          if (container == null)
          {
              return null;
          }
  
          FluidContainerData data = containerFluidMap.get(new ContainerKey(container));
          return data == null ? null : data.fluid.copy();
      }
  
      /**
       * Attempts to fill an empty container with a fluid.
       *
       * NOTE: Returns null on fail, NOT the empty container.
       *
       * @param fluid
       *            FluidStack containing the type and amount of fluid to fill.
       * @param container
       *            ItemStack representing the empty container.
       * @return Filled container if successful, otherwise null.
       */
      public static ItemStack fillFluidContainer(FluidStack fluid, ItemStack container)
      {
          if (container == null || fluid == null)
          {
              return null;
          }
  
          FluidContainerData data = filledContainerMap.get(new ContainerKey(container, fluid));
          if (data != null && fluid.amount >= data.fluid.amount)
          {
              return data.filledContainer.copy();
          }
          return null;
      }
  
      /**
       * Attempts to empty a full container.
       *
       * @param container
       *            ItemStack representing the full container.
       * @return Empty container if successful, otherwise null.
       */
      public static ItemStack drainFluidContainer(ItemStack container)
      {
  