@@ -0,0 +1,3249 @@
+package deterno.fight.tgm.damage.tracker.base;%0A%0Aimport com.google.common.base.Preconditions;%0Aimport com.google.common.collect.ImmutableSet;%0Aimport com.google.common.collect.Maps;%0Aimport deterno.fight.tgm.damage.tracker.Tracker;%0Aimport deterno.fight.tgm.damage.tracker.TrackerManager;%0Aimport org.bukkit.World;%0A%0Aimport javax.annotation.Nonnull;%0Aimport javax.annotation.Nullable;%0Aimport java.util.Map;%0Aimport java.util.Set;%0A%0Apublic class SimpleTrackerManager implements TrackerManager %7B%0A    public Set%3CTracker%3E getTrackers() %7B%0A        return ImmutableSet.copyOf(this.trackers.values());%0A    %7D%0A%0A    public boolean hasTracker(@Nonnull Class%3C? extends Tracker%3E trackerClass) %7B%0A        return this.getTracker(trackerClass) != null;%0A    %7D%0A%0A    public @Nullable%0A    %3CT extends Tracker%3E T getTracker(@Nonnull Class%3CT%3E trackerClass) %7B%0A        Preconditions.checkNotNull(trackerClass, %22tracker class%22);%0A%0A        return findTracker(this.trackers, trackerClass);%0A    %7D%0A%0A    public @Nullable%0A    %3CT extends Tracker%3E T setTracker(@Nonnull Class%3CT%3E trackerClass, @Nullable T tracker) %7B%0A        Preconditions.checkNotNull(trackerClass, %22tracker class%22);%0A        Preconditions.checkArgument(trackerClass.isInstance(tracker), %22tracker is not an instance of the specified class%22);%0A%0A        return setTrackerInDB(this.trackers, trackerClass, tracker);%0A    %7D%0A%0A    @SuppressWarnings(%22unchecked%22)%0A    public @Nullable%0A    %3CT extends Tracker%3E T clearTracker(@Nonnull Class%3CT%3E trackerClass) %7B%0A        Preconditions.checkNotNull(trackerClass, %22tracker class%22);%0A%0A        return (T) this.trackers.remove(trackerClass);%0A    %7D%0A%0A    @SuppressWarnings(%22unchecked%22)%0A    public @Nullable%0A    %3CT extends Tracker%3E T clearTracker(@Nonnull Class%3CT%3E trackerClass, @Nonnull Class%3C? extends T%3E trackerImplClass) %7B%0A        Preconditions.checkNotNull(trackerClass, %22tracker class%22);%0A        Preconditions.checkNotNull(trackerImplClass, %22tracker implementation class%22);%0A%0A        Tracker tracker = this.trackers.get(trackerClass);%0A        if(trackerImplClass.isInstance(tracker)) %7B%0A            return (T) this.trackers.remove(trackerClass);%0A        %7D else %7B%0A            return null;%0A        %7D%0A    %7D%0A%0A    @SuppressWarnings(%22unchecked%22)%0A    private static @Nullable%0A    %3CT extends Tracker%3E T findTracker(@Nonnull Map%3CClass%3C? extends Tracker%3E, Tracker%3E db, @Nonnull Class%3CT%3E search) %7B%0A        for(Map.Entry%3CClass%3C? extends Tracker%3E, Tracker%3E entry : db.entrySet()) %7B%0A            if(search.isAssignableFrom(entry.getKey())) %7B%0A                return (T) entry.getValue();%0A            %7D%0A        %7D%0A        return null;%0A    %7D%0A%0A    @SuppressWarnings(%22unchecked%22)%0A    private static @Nullable%0A    %3CT extends Tracker%3E T setTrackerInDB(@Nonnull Map%3CClass%3C? extends Tracker%3E, Tracker%3E db, @Nonnull Class%3CT%3E trackerClass, @Nullable T tracker) %7B%0A        if(tracker != null) %7B%0A            return (T) db.put(trackerClass, tracker);%0A        %7D else %7B%0A            return (T) db.remove(trackerClass);%0A        %7D%0A    %7D%0A%0A    public void clearTrackers(@Nonnull World world) %7B%0A        Preconditions.checkNotNull(world, %22world%22);%0A%0A        for(Tracker tracker : this.getTrackers()) %7B%0A            tracker.clear(world);%0A        %7D%0A    %7D%0A%0A    private final Map%3CClass%3C? extends Tracker%3E, Tracker%3E trackers = Maps.newHashMap();%0A%7D%0A

Create SimpleTrackerManager.java