diff --git a/forge-core/src/main/java/forge/util/collect/FCollection.java b/forge-core/src/main/java/forge/util/collect/FCollection.java index bb100a53787..ac523f54560 100644 --- a/forge-core/src/main/java/forge/util/collect/FCollection.java +++ b/forge-core/src/main/java/forge/util/collect/FCollection.java @@ -530,6 +530,18 @@ public class FCollection implements List, /*Set,*/ FCollectionView, return Iterables.unmodifiableIterable(new LinkedList(list)); } + @Override + public T get(final T obj) { + if (obj == null) { + return null; + } + for(T x : this) { + if (x.equals(obj)) { + return x; + } + } + return obj; + } /** * An unmodifiable, empty {@link FCollection}. Overrides all methods with * default implementations suitable for an empty collection, to improve diff --git a/forge-core/src/main/java/forge/util/collect/FCollectionView.java b/forge-core/src/main/java/forge/util/collect/FCollectionView.java index 63f7867e374..56da5c6d0a4 100644 --- a/forge-core/src/main/java/forge/util/collect/FCollectionView.java +++ b/forge-core/src/main/java/forge/util/collect/FCollectionView.java @@ -74,4 +74,6 @@ public interface FCollectionView extends Iterable { * {@link Iterator#remove()}), as such an operation would have no meaning. */ Iterable threadSafeIterable(); + + T get(final T obj); } \ No newline at end of file