// Path: src/main/java/tc/oc/tracker/Damage.java
// public interface Damage {
//     /**
//      * Gets the amount of damage that was inflicted.
//      *
//      * Note that this is the raw damage in half-hearts before dampeners (armor,
//      * potion effects) are applied.
//      *
//      * Contract specifies that the result is 0 or greater.
//      *
//      * @return Amount of damage inflicted
//      */
//     int getDamage();
// 
//     /**
//      * Gets the location where the damage occurred.
//      *
//      * Contract specifies that the result is never null.
//      *
//      * @return Location of damage
//      */
//     @Nonnull Location getLocation();
// 
//     /**
//      * Gets the time that the damage occurred.
//      *
//      * Contract specifies that the result is never null.
//      *
//      * @return Time of damage
//      */
//     @Nonnull Instant getTime();
// 
//     /**
//      * Gets additional information regarding this damage.
//      *
//      * @return {@link DamageInfo} subclass describing the damage in more detail
//      */
//     @Nonnull DamageInfo getInfo();
// }
// 
// Path: src/main/java/tc/oc/tracker/DamageInfo.java
// public interface DamageInfo {
//     /**
//      * Gets the living entity most responsible for this damage.
//      *
//      * @return Resolved damager or null if none exists
//      */
//     @Nullable LivingEntity getResolvedDamager();
// }
// 
// Path: src/main/java/tc/oc/tracker/Lifetime.java
// public interface Lifetime {
//     @Nullable Instant getStart();
// 
//     void setStart(@Nonnull Instant start);
// 
//     @Nullable Instant getEnd();
// 
//     void setEnd(@Nonnull Instant end);
// 
//     @Nonnull List<Damage> getDamage();
// 
//     @Nonnull ListIterator<Damage> getDamageFirst();
// 
//     @Nonnull ListIterator<Damage> getDamageLast();
// 
//     @Nullable Damage getFirstDamage();
// 
//     @Nullable Damage getLastDamage();
// 
//     /**
//      * Gets the last damage instance where the info object is an instance of
//      * the specified class. Uses {@link Class#isInstance(Object)} to check info
//      * objects.
//      *
//      * @param damageInfoClass DamageInfo class to check for
//      * @return Last damage that matched or null if none matched
//      *
//      * @throws NullPointerException if damageInfoClass is null
//      */
//     @Nullable Damage getLastDamage(@Nonnull Class<? extends DamageInfo> damageInfoClass);
// 
//     void addDamage(@Nonnull Damage damage);
// }


import java.util.Collections;
import java.util.List;
import java.util.ListIterator;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.joda.time.Instant;
import tc.oc.tracker.Damage;
import tc.oc.tracker.DamageInfo;
import tc.oc.tracker.Lifetime;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
    }

    public @Nonnull List<Damage> getDamage() {
        return Collections.unmodifiableList(this.damage);
    }

    public @Nonnull ListIterator<Damage> getDamageFirst() {
        return Collections.unmodifiableList(this.damage).listIterator();
    }

    public @Nonnull ListIterator<Damage> getDamageLast() {
        return Collections.unmodifiableList(this.damage).listIterator(this.damage.size());
    }

    public @Nullable Damage getFirstDamage() {
        if(!this.damage.isEmpty()) {
            return this.damage.get(0);
        } else {
            return null;
        }
    }

    public @Nullable Damage getLastDamage() {
        if(!this.damage.isEmpty()) {
            return this.damage.get(this.damage.size() - 1);
        } else {
            return null;
        }
    }

// Path: src/main/java/tc/oc/tracker/Damage.java
// public interface Damage {
//     /**
//      * Gets the amount of damage that was inflicted.
//      *
//      * Note that this is the raw damage in half-hearts before dampeners (armor,
//      * potion effects) are applied.
//      *
//      * Contract specifies that the result is 0 or greater.
//      *
//      * @return Amount of damage inflicted
//      */
//     int getDamage();
// 
//     /**
//      * Gets the location where the damage occurred.
//      *
//      * Contract specifies that the result is never null.
//      *
//      * @return Location of damage
//      */
//     @Nonnull Location getLocation();
// 
//     /**
//      * Gets the time that the damage occurred.
//      *
//      * Contract specifies that the result is never null.
//      *
//      * @return Time of damage
//      */
//     @Nonnull Instant getTime();
// 
//     /**
//      * Gets additional information regarding this damage.
//      *
//      * @return {@link DamageInfo} subclass describing the damage in more detail
//      */
//     @Nonnull DamageInfo getInfo();
// }
// 
// Path: src/main/java/tc/oc/tracker/DamageInfo.java
// public interface DamageInfo {
//     /**
//      * Gets the living entity most responsible for this damage.
//      *
//      * @return Resolved damager or null if none exists
//      */
//     @Nullable LivingEntity getResolvedDamager();
// }
// 
// Path: src/main/java/tc/oc/tracker/Lifetime.java
// public interface Lifetime {
//     @Nullable Instant getStart();
// 
//     void setStart(@Nonnull Instant start);
// 
//     @Nullable Instant getEnd();
// 
//     void setEnd(@Nonnull Instant end);
// 
//     @Nonnull List<Damage> getDamage();
// 
//     @Nonnull ListIterator<Damage> getDamageFirst();
// 
//     @Nonnull ListIterator<Damage> getDamageLast();
// 
//     @Nullable Damage getFirstDamage();
// 
//     @Nullable Damage getLastDamage();
// 
//     /**
//      * Gets the last damage instance where the info object is an instance of
//      * the specified class. Uses {@link Class#isInstance(Object)} to check info
//      * objects.
//      *
//      * @param damageInfoClass DamageInfo class to check for
//      * @return Last damage that matched or null if none matched
//      *
//      * @throws NullPointerException if damageInfoClass is null
//      */
//     @Nullable Damage getLastDamage(@Nonnull Class<? extends DamageInfo> damageInfoClass);
// 
//     void addDamage(@Nonnull Damage damage);
// }


// Path: src/main/java/tc/oc/tracker/base/SimpleLifetime.java
import java.util.Collections;
import java.util.List;
import java.util.ListIterator;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.joda.time.Instant;
import tc.oc.tracker.Damage;
import tc.oc.tracker.DamageInfo;
import tc.oc.tracker.Lifetime;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;

    }

    public @Nonnull List<Damage> getDamage() {
        return Collections.unmodifiableList(this.damage);
    }

    public @Nonnull ListIterator<Damage> getDamageFirst() {
        return Collections.unmodifiableList(this.damage).listIterator();
    }

    public @Nonnull ListIterator<Damage> getDamageLast() {
        return Collections.unmodifiableList(this.damage).listIterator(this.damage.size());
    }

    public @Nullable Damage getFirstDamage() {
        if(!this.damage.isEmpty()) {
            return this.damage.get(0);
        } else {
            return null;
        }
    }

    public @Nullable Damage getLastDamage() {
        if(!this.damage.isEmpty()) {
            return this.damage.get(this.damage.size() - 1);
        } else {
            return null;
        }
    }

    public @Nullable Damage getLastDamage(@Nonnull Class<? extends DamageInfo> damageInfoClass) {