IDEA-79726 (Grails: 'Create action' intention should create action in bottom of controller.)

This commit is contained in:
Sergey Evdokimov
2012-01-27 20:13:59 +04:00
parent 8ba8ff5dc9
commit 1873ea87b9
@@ -677,6 +677,17 @@ public class ContainerUtil {
return items == null || items.isEmpty() ? def : items.iterator().next();
}
@Nullable
public static <T> T getLastItem(final Collection<T> items) {
Iterator<T> itr = items.iterator();
T res = null;
while (itr.hasNext()) {
res = itr.next();
}
return res;
}
@NotNull
public static <T> Collection<T> subtract(@NotNull Collection<T> from, @NotNull Collection<T> what) {
final HashSet<T> set = new HashSet<T>(from);