This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/master by this push:
     new d20fec7  ISIS-1841 refining _Set and _List, and introducing _Reduction
d20fec7 is described below

commit d20fec7daf4e63a181a38095cff72b4d40288464
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Sun Apr 15 20:41:34 2018 +0200

    ISIS-1841 refining _Set and _List, and introducing _Reduction
    
    also replacing lots of guava predicates
---
 ...ectContractsLegacyTest_equals_and_hashCode.java |   4 +-
 .../isis/applib/ModuleOrBuilderAbstract.java       |   2 +-
 .../apache/isis/applib/fixtures/LogonFixture.java  |   2 +-
 .../isis/applib/internal/base/_NullSafe.java       |  16 +++
 .../isis/applib/internal/base/_Reduction.java      |  80 ++++++++++++
 .../isis/applib/internal/collections/_Lists.java   |  26 +++-
 .../isis/applib/internal/collections/_Sets.java    |  35 +++++-
 .../services/config/ConfigurationProperty.java     |   2 +-
 .../Module_Util_transitiveDependenciesOf_Test.java |  26 ++--
 .../isis/applib/internal/base/ReductionTest.java   |  73 +++++++++++
 .../ObjectContractsTest_equals_and_hashCode.java   |   4 +-
 .../isis/core/metamodel/adapter/ObjectAdapter.java |  25 ++--
 ...ctionInvocationFacetForDomainEventAbstract.java |   8 +-
 .../actions/action/invocation/CommandUtil.java     |  15 +--
 .../CollectionAccessorFacetViaAccessor.java        |   5 +-
 .../javautilcollection/JavaCollectionFacet.java    |   6 +-
 .../choices/ChoicesFacetFromBoundedAbstract.java   |  16 +--
 .../ActionParameterAutoCompleteFacetViaMethod.java |   8 +-
 .../method/ActionChoicesFacetViaMethod.java        |  10 +-
 .../ActionParameterChoicesFacetViaMethod.java      |   8 +-
 .../method/PropertyAutoCompleteFacetMethod.java    |   6 +-
 .../bookmarks/BookmarkServiceInternalDefault.java  |   4 +-
 .../metamodel/MetaModelServiceDefault.java         |   5 +-
 .../specimpl/OneToOneAssociationDefault.java       |  27 +++--
 .../wicket/viewer/IsisWicketApplication.java       |   2 +-
 .../model/mementos/ObjectAdapterMemento.java       | 102 +++++++++++++---
 .../viewer/wicket/model/models/ActionModel.java    |  29 ++---
 .../wicket/model/models/EntityCollectionModel.java | 135 +++++++++------------
 .../viewer/wicket/model/models/ScalarModel.java    |  30 ++---
 .../isis/viewer/wicket/model/models/Util.java      |  28 +++++
 .../models/LowestCommonSuperclassClosureTest.java  |  15 ++-
 .../collection/bulk/BulkActionsLinkFactory.java    |  35 +++---
 .../scalars/reference/ReferencePanel.java          |  51 ++++----
 .../valuechoices/ValueChoicesSelect2Panel.java     |  23 ++--
 ...entoProviderForReferenceObjectAutoComplete.java |  13 +-
 ...derForReferenceParamOrPropertyAutoComplete.java |  13 +-
 36 files changed, 588 insertions(+), 301 deletions(-)

diff --git 
a/core/applib-legacy/src/test/java/org/apache/isis/applib/util/ObjectContractsLegacyTest_equals_and_hashCode.java
 
b/core/applib-legacy/src/test/java/org/apache/isis/applib/util/ObjectContractsLegacyTest_equals_and_hashCode.java
index 7432e74..a84e6cd 100644
--- 
a/core/applib-legacy/src/test/java/org/apache/isis/applib/util/ObjectContractsLegacyTest_equals_and_hashCode.java
+++ 
b/core/applib-legacy/src/test/java/org/apache/isis/applib/util/ObjectContractsLegacyTest_equals_and_hashCode.java
@@ -37,7 +37,7 @@ public class ObjectContractsLegacyTest_equals_and_hashCode 
extends ValueTypeCont
 
     @Override
     protected List<InvoiceItem3> getObjectsWithSameValue() {
-        return _Lists.unmodifiable(
+        return _Lists.of(
                     InvoiceItem3.newInvoiceItem(inv123, "A", new Integer(1)),
                     InvoiceItem3.newInvoiceItem(inv123, "A", new Integer(1))
                 );
@@ -45,7 +45,7 @@ public class ObjectContractsLegacyTest_equals_and_hashCode 
extends ValueTypeCont
 
     @Override
     protected List<InvoiceItem3> getObjectsWithDifferentValue() {
-        return _Lists.unmodifiable(
+        return _Lists.of(
                     InvoiceItem3.newInvoiceItem(null, "A", new Integer(2)),
                     InvoiceItem3.newInvoiceItem(inv456, "A", new Integer(2)),
                     InvoiceItem3.newInvoiceItem(inv123, null, new Integer(1)),
diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/ModuleOrBuilderAbstract.java 
b/core/applib/src/main/java/org/apache/isis/applib/ModuleOrBuilderAbstract.java
index c138c77..479d0fd 100644
--- 
a/core/applib/src/main/java/org/apache/isis/applib/ModuleOrBuilderAbstract.java
+++ 
b/core/applib/src/main/java/org/apache/isis/applib/ModuleOrBuilderAbstract.java
@@ -58,7 +58,7 @@ abstract class ModuleOrBuilderAbstract<B extends 
ModuleOrBuilderAbstract<B>> {
     }
 
     public B withAdditionalDependencies(final Module... dependencies) {
-        return withAdditionalDependencies(_Sets.unmodifiable(dependencies));
+        return withAdditionalDependencies(_Sets.of(dependencies));
     }
 
     void withTransitiveFrom(final Module module) {
diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/fixtures/LogonFixture.java 
b/core/applib/src/main/java/org/apache/isis/applib/fixtures/LogonFixture.java
index ce4e5e4..b0b9c0b 100644
--- 
a/core/applib/src/main/java/org/apache/isis/applib/fixtures/LogonFixture.java
+++ 
b/core/applib/src/main/java/org/apache/isis/applib/fixtures/LogonFixture.java
@@ -52,7 +52,7 @@ public class LogonFixture implements InstallableFixture {
      */
     @Deprecated
     public LogonFixture(final String username, final String... roles) {
-        this(username, _Lists.unmodifiable(roles));
+        this(username, _Lists.of(roles));
     }
 
     /**
diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/internal/base/_NullSafe.java 
b/core/applib/src/main/java/org/apache/isis/applib/internal/base/_NullSafe.java
index c6b4b99..f3c23a2 100644
--- 
a/core/applib/src/main/java/org/apache/isis/applib/internal/base/_NullSafe.java
+++ 
b/core/applib/src/main/java/org/apache/isis/applib/internal/base/_NullSafe.java
@@ -178,6 +178,22 @@ public final class _NullSafe {
        public static boolean isEmpty(short[] array){ return array==null || 
array.length == 0;}
        public static <T> boolean isEmpty(T[] array){ return array==null || 
array.length == 0;}
 
+       // -- SIZE/LENGTH CHECKS
+       
+       public static int size(String x){ return x!=null ? x.length() : 0; }
+       public static int size(Collection<?> x){ return x!=null ? x.size() : 0; 
}
+       public static int size(Map<?,?> x){ return x!=null ? x.size() : 0; }
+       public static int size(boolean[] array){ return array!=null ? 
array.length : 0; }
+       public static int size(byte[] array){ return array!=null ? array.length 
: 0; }
+       public static int size(char[] array){ return array!=null ? array.length 
: 0; }
+       public static int size(double[] array){ return array!=null ? 
array.length : 0; }
+       public static int size(float[] array){ return array!=null ? 
array.length : 0; }
+       public static int size(int[] array){ return array!=null ? array.length 
: 0; }
+       public static int size(long[] array){ return array!=null ? array.length 
: 0; }
+       public static int size(short[] array){ return array!=null ? 
array.length : 0; }
+       public static <T> int size(T[] array){ return array!=null ? 
array.length : 0; }
+
+       
        // -- MAP
        
        /**
diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/internal/base/_Reduction.java
 
b/core/applib/src/main/java/org/apache/isis/applib/internal/base/_Reduction.java
new file mode 100644
index 0000000..b915938
--- /dev/null
+++ 
b/core/applib/src/main/java/org/apache/isis/applib/internal/base/_Reduction.java
@@ -0,0 +1,80 @@
+package org.apache.isis.applib.internal.base;
+
+import java.util.Objects;
+import java.util.Optional;
+import java.util.function.BinaryOperator;
+import java.util.function.Consumer;
+import java.util.stream.Stream;
+
+import javax.annotation.Nullable;
+
+/**
+ * <h1>- internal use only -</h1>
+ * <p>
+ *  Provides a generic reduction class. Most intuitive example of a reduction 
is finding the 
+ *  minimum value from a list of values. See {@link ReductionTest} for 
examples.
+ * </p>
+ * <p>
+ * <b>WARNING</b>: Do <b>NOT</b> use any of the classes provided by this 
package! <br/> 
+ * These may be changed or removed without notice!
+ * </p>
+ * 
+ * @since 2.0.0
+ *
+ */
+public final class _Reduction<T> implements Consumer<T> {
+
+       private final BinaryOperator<T> accumulator;
+       private T result;
+       private boolean initialized = false;
+       
+       
+       /**
+        * Inspired by {@link Stream#reduce(Object, BinaryOperator)}
+        * @param identity
+        * @param accumulator
+        * @return
+        */
+       public static <T> _Reduction<T> of(@Nullable T identity, 
BinaryOperator<T> accumulator){
+               return new _Reduction<T>(identity, accumulator, true);
+       }
+       
+       /**
+        * Inspired by {@link Stream#reduce(BinaryOperator)}
+        * @param accumulator
+        * @return
+        */
+       public static <T> _Reduction<T> of(BinaryOperator<T> accumulator){
+               return new _Reduction<T>(null, accumulator, false);
+       }
+
+       private _Reduction(@Nullable T identity, BinaryOperator<T> accumulator, 
boolean initialized) {
+               Objects.requireNonNull(accumulator);
+               this.initialized = initialized;
+               this.result = identity;
+               this.accumulator = accumulator;
+       }
+
+       @Override
+       public void accept(@Nullable T next) {
+               if(!initialized) {
+                       result = next;
+                       initialized = true;
+                       return;
+               }
+               result = accumulator.apply(result, next);
+       }
+       
+       /**
+        * Returns the reduction result if ever initialized, Optional.empty() 
otherwise.
+        * @return non-null
+        */
+       public Optional<T> getResult() {
+               if(!initialized) {
+                       return Optional.empty();
+               }
+               return Optional.ofNullable(result);
+       }
+       
+       
+}
diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/internal/collections/_Lists.java
 
b/core/applib/src/main/java/org/apache/isis/applib/internal/collections/_Lists.java
index e0e95cb..eaa6595 100644
--- 
a/core/applib/src/main/java/org/apache/isis/applib/internal/collections/_Lists.java
+++ 
b/core/applib/src/main/java/org/apache/isis/applib/internal/collections/_Lists.java
@@ -61,13 +61,33 @@ public final class _Lists {
        // -- UNMODIFIABLE LIST
        
        /**
+        * Returns an unmodifiable list containing only the specified element.
+        * @param element (required)
+        * @return non null
+        */
+       public static <T> List<T> singleton(T element) {
+               Objects.requireNonNull(element); // don't accept null element
+               return Collections.singletonList(element);
+       }
+       
+       /**
+        * Returns an unmodifiable list containing only the specified element 
or 
+        * the empty list if the element is null. 
+        * @param element
+        * @return non null
+        */
+       public static <T> List<T> singletonOrElseEmpty(@Nullable T element) {
+               return element != null ? Collections.singletonList(element) : 
Collections.emptyList();
+       }
+
+       /**
         * Copies all elements into a new unmodifiable List.
         * @param elements
         * @return non null
         */
        @SafeVarargs
-       public static <T> List<T> unmodifiable(T ... elements) {
-               Objects.requireNonNull(elements); // don't accept null elements
+       public static <T> List<T> of(T ... elements) {
+               Objects.requireNonNull(elements); // don't accept null as 
argument
                if(elements.length==0) {
                        return Collections.emptyList();
                }
@@ -79,7 +99,7 @@ public final class _Lists {
         * @param iterable
         * @return non null
         */
-       public static <T> List<T> unmodifiable(Iterable<T> iterable) {
+       public static <T> List<T> unmodifiable(@Nullable Iterable<T> iterable) {
                if(iterable==null) {
                        return Collections.emptyList();
                }
diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/internal/collections/_Sets.java
 
b/core/applib/src/main/java/org/apache/isis/applib/internal/collections/_Sets.java
index 6556fb9..6abd9b1 100644
--- 
a/core/applib/src/main/java/org/apache/isis/applib/internal/collections/_Sets.java
+++ 
b/core/applib/src/main/java/org/apache/isis/applib/internal/collections/_Sets.java
@@ -54,13 +54,37 @@ public final class _Sets {
        
        // -- UNMODIFIABLE SET
        
+       /**
+        * Returns an unmodifiable set containing only the specified element.
+        * @param element (required)
+        * @return non null
+        */
+       public static <T> Set<T> singleton(T element) {
+               Objects.requireNonNull(element); // don't accept null element
+               return Collections.singleton(element);
+       }
+       
+       /**
+        * Returns an unmodifiable set containing only the specified element or 
+        * the empty list if the element is null. 
+        * @param element
+        * @return non null
+        */
+       public static <T> Set<T> singletonOrElseEmpty(@Nullable T element) {
+               return element != null ? Collections.singleton(element) : 
Collections.emptySet();
+       }
+
+       /**
+        * Copies all elements into a new unmodifiable List.
+        * @param elements
+        * @return non null
+        */
        @SafeVarargs
-       public static <T> Set<T> unmodifiable(T ... elements) {
-               Objects.requireNonNull(elements); // don't accept null elements
+       public static <T> Set<T> of(T ... elements) {
+               Objects.requireNonNull(elements); // don't accept null as 
argument
                if(elements.length==0) {
                        return Collections.emptySet();
                }
-               
                final Set<T> setPreservingOrder = newLinkedHashSet();
                
                Stream.of(elements)
@@ -69,6 +93,11 @@ public final class _Sets {
                return Collections.unmodifiableSet(setPreservingOrder);
        }
        
+       /**
+        * Copies all elements from iterable into a new unmodifiable Set 
preserving iteration order.
+        * @param iterable
+        * @return non null
+        */
        public static <T> Set<T> unmodifiable(Iterable<T> iterable) {
                if(iterable==null) {
                        return Collections.emptySet();
diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/services/config/ConfigurationProperty.java
 
b/core/applib/src/main/java/org/apache/isis/applib/services/config/ConfigurationProperty.java
index 20ccb19..f123ca7 100644
--- 
a/core/applib/src/main/java/org/apache/isis/applib/services/config/ConfigurationProperty.java
+++ 
b/core/applib/src/main/java/org/apache/isis/applib/services/config/ConfigurationProperty.java
@@ -88,7 +88,7 @@ public class ConfigurationProperty implements 
Comparable<ConfigurationProperty>
     public static class Util {
 
         private static final List<String> PROTECTED_KEYS =
-                       _Lists.unmodifiable("password", "apiKey", "authToken");
+                       _Lists.of("password", "apiKey", "authToken");
                 
 
         private Util(){}
diff --git 
a/core/applib/src/test/java/org/apache/isis/applib/Module_Util_transitiveDependenciesOf_Test.java
 
b/core/applib/src/test/java/org/apache/isis/applib/Module_Util_transitiveDependenciesOf_Test.java
index a5e43cb..ce4301e 100644
--- 
a/core/applib/src/test/java/org/apache/isis/applib/Module_Util_transitiveDependenciesOf_Test.java
+++ 
b/core/applib/src/test/java/org/apache/isis/applib/Module_Util_transitiveDependenciesOf_Test.java
@@ -62,22 +62,22 @@ public class Module_Util_transitiveDependenciesOf_Test {
         }
         @Override
         public Set<Class<?>> getAdditionalModules() {
-            return _Sets.<Class<?>>unmodifiable(ModuleP.class);
+            return _Sets.<Class<?>>of(ModuleP.class);
         }
     };
     final Module moduleD = new ModuleImpl("D") {
         @Override public Set<Module> getDependencies() {
-            return _Sets.unmodifiable(moduleE);
+            return _Sets.of(moduleE);
         }
     };
 
     final Module moduleC = new ModuleImpl("C") {
         @Override public Set<Module> getDependencies() {
-            return _Sets.unmodifiable(moduleE, moduleD);
+            return _Sets.of(moduleE, moduleD);
         }
         @Override
         public Set<Class<?>> getAdditionalModules() {
-            return _Sets.unmodifiable(ModuleQ.class, ModuleR.class);
+            return _Sets.of(ModuleQ.class, ModuleR.class);
         }
         {
             withAdditionalServices(ServiceY.class, ServiceZ.class);
@@ -85,29 +85,29 @@ public class Module_Util_transitiveDependenciesOf_Test {
     };
     final Module moduleB = new ModuleImpl("B") {
         @Override public Set<Module> getDependencies() {
-            return _Sets.unmodifiable(moduleF, moduleC);
+            return _Sets.of(moduleF, moduleC);
         }
     };
     final Module moduleA = new ModuleImpl("A") {
         @Override public Set<Module> getDependencies() {
-            return _Sets.unmodifiable(moduleE, moduleC);
+            return _Sets.of(moduleE, moduleC);
         }
     };
 
     final Module moduleG = new ModuleImpl("G") {
         @Override public Set<Module> getDependencies() {
-            return _Sets.unmodifiable(moduleH);
+            return _Sets.of(moduleH);
         }
     };
     final Module moduleH = new ModuleImpl("H") {
         @Override public Set<Module> getDependencies() {
-            return _Sets.unmodifiable(moduleI);
+            return _Sets.of(moduleI);
         }
     };
 
     final Module moduleI = new ModuleImpl("I") {
         @Override public Set<Module> getDependencies() {
-            return _Sets.unmodifiable(moduleG);
+            return _Sets.of(moduleG);
         }
     };
 
@@ -132,16 +132,16 @@ public class Module_Util_transitiveDependenciesOf_Test {
         assertTransitiveDependencies(
                 moduleE, Arrays.asList(moduleE));
         assertTransitiveDependenciesAsClass(
-                moduleE, _Lists.<Class<?>>unmodifiable(ModuleP.class));
+                moduleE, _Lists.<Class<?>>of(ModuleP.class));
         assertTransitiveServices(
-                moduleE, _Lists.<Class<?>>unmodifiable(ServiceX.class));
+                moduleE, _Lists.<Class<?>>of(ServiceX.class));
 
         assertTransitiveDependencies(
                 moduleD, Arrays.asList(moduleE, moduleD));
         assertTransitiveDependenciesAsClass(
-                moduleD, _Lists.<Class<?>>unmodifiable(ModuleP.class));
+                moduleD, _Lists.<Class<?>>of(ModuleP.class));
         assertTransitiveServices(
-                moduleD, _Lists.<Class<?>>unmodifiable(ServiceX.class));
+                moduleD, _Lists.<Class<?>>of(ServiceX.class));
 
         assertTransitiveDependencies(
                 moduleC, Arrays.asList(moduleE, moduleD, moduleC));
diff --git 
a/core/applib/src/test/java/org/apache/isis/applib/internal/base/ReductionTest.java
 
b/core/applib/src/test/java/org/apache/isis/applib/internal/base/ReductionTest.java
new file mode 100644
index 0000000..aa6d861
--- /dev/null
+++ 
b/core/applib/src/test/java/org/apache/isis/applib/internal/base/ReductionTest.java
@@ -0,0 +1,73 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.applib.internal.base;
+
+import static org.hamcrest.CoreMatchers.is;
+
+import java.util.List;
+
+import org.apache.isis.applib.internal.collections._Lists;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class ReductionTest {
+
+       @Test
+       public void findMinimum() throws Exception {
+               
+               final List<Integer> values = _Lists.of(5, 4, 3, 2, 1, 2, 3, 4);
+               
+               _Reduction<Integer> toMinReduction = _Reduction.of((min, 
next)-> next<min ? next : min);
+               
+               values.forEach(toMinReduction);
+               
+               Assert.assertThat(toMinReduction.getResult().get(), is(1));
+       }
+       
+       @Test
+       public void findMinimum_initialized_low() throws Exception {
+               
+               final int initial = -1;
+               
+               final List<Integer> values = _Lists.of(5, 4, 3, 2, 1, 2, 3, 4);
+               
+               _Reduction<Integer> toMinReduction = _Reduction.of(initial, 
(min, next)-> next<min ? next : min);
+               
+               values.forEach(toMinReduction);
+               
+               Assert.assertThat(toMinReduction.getResult().get(), 
is(initial));
+       }
+       
+       @Test
+       public void findMinimum_initialized_high() throws Exception {
+               
+               final int initial = 3;
+               
+               final List<Integer> values = _Lists.of(5, 4, 3, 2, 1, 2, 3, 4);
+               
+               _Reduction<Integer> toMinReduction = _Reduction.of(initial, 
(min, next)-> next<min ? next : min);
+               
+               values.forEach(toMinReduction);
+               
+               Assert.assertThat(toMinReduction.getResult().get(), is(1));
+       }
+       
+       
+}
diff --git 
a/core/applib/src/test/java/org/apache/isis/applib/util/ObjectContractsTest_equals_and_hashCode.java
 
b/core/applib/src/test/java/org/apache/isis/applib/util/ObjectContractsTest_equals_and_hashCode.java
index b40c630..15dae41 100644
--- 
a/core/applib/src/test/java/org/apache/isis/applib/util/ObjectContractsTest_equals_and_hashCode.java
+++ 
b/core/applib/src/test/java/org/apache/isis/applib/util/ObjectContractsTest_equals_and_hashCode.java
@@ -37,7 +37,7 @@ public class ObjectContractsTest_equals_and_hashCode extends 
ValueTypeContractTe
 
     @Override
     protected List<InvoiceItem3> getObjectsWithSameValue() {
-        return _Lists.unmodifiable(
+        return _Lists.of(
                     InvoiceItem3.newInvoiceItem(inv123, "A", new Integer(1)),
                     InvoiceItem3.newInvoiceItem(inv123, "A", new Integer(1))
                 );
@@ -45,7 +45,7 @@ public class ObjectContractsTest_equals_and_hashCode extends 
ValueTypeContractTe
 
     @Override
     protected List<InvoiceItem3> getObjectsWithDifferentValue() {
-        return _Lists.unmodifiable(
+        return _Lists.of(
                     InvoiceItem3.newInvoiceItem(null, "A", new Integer(2)),
                     InvoiceItem3.newInvoiceItem(inv456, "A", new Integer(2)),
                     InvoiceItem3.newInvoiceItem(inv123, null, new Integer(1)),
diff --git 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/ObjectAdapter.java
 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/ObjectAdapter.java
index 7944c76..ed2b028 100644
--- 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/ObjectAdapter.java
+++ 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/ObjectAdapter.java
@@ -22,11 +22,10 @@ package org.apache.isis.core.metamodel.adapter;
 import java.lang.reflect.Method;
 import java.util.List;
 import java.util.Map;
-
-import com.google.common.base.Function;
-import com.google.common.collect.Lists;
+import java.util.function.Function;
 
 import org.apache.isis.applib.annotation.Where;
+import org.apache.isis.applib.internal.collections._Lists;
 import org.apache.isis.core.commons.lang.ClassExtensions;
 import org.apache.isis.core.commons.lang.ListExtensions;
 import org.apache.isis.core.commons.lang.MethodExtensions;
@@ -221,7 +220,7 @@ public interface ObjectAdapter extends Instance {
         }
 
         public static List<Object> unwrap(final List<ObjectAdapter> adapters) {
-            List<Object> objects = Lists.newArrayList();
+            List<Object> objects = _Lists.newArrayList();
             for (ObjectAdapter adapter : adapters) {
                 objects.add(unwrap(adapter));
             }
@@ -310,7 +309,7 @@ public interface ObjectAdapter extends Instance {
         public static List<ObjectAdapter> visibleAdapters(
                 final Iterable<ObjectAdapter> objectAdapters,
                 final InteractionInitiatedBy interactionInitiatedBy) {
-            final List<ObjectAdapter> adapters = Lists.newArrayList();
+            final List<ObjectAdapter> adapters = _Lists.newArrayList();
             for (final ObjectAdapter adapter : objectAdapters) {
                 final boolean visible = isVisible(adapter,
                         interactionInitiatedBy);
@@ -413,7 +412,7 @@ public interface ObjectAdapter extends Instance {
          * </ul>
          */
         public static Object invokeAutofit(final Method method, final 
ObjectAdapter target, List<ObjectAdapter> argumentsIfAvailable, final 
AdapterManager adapterManager) {
-            final List<ObjectAdapter> args = Lists.newArrayList();
+            final List<ObjectAdapter> args = _Lists.newArrayList();
             if(argumentsIfAvailable != null) {
                 args.addAll(argumentsIfAvailable);
             }
@@ -475,7 +474,12 @@ public interface ObjectAdapter extends Instance {
         private Functions(){}
 
         public static Function<ObjectAdapter, Object> getObject() {
-            return new Function<ObjectAdapter, Object>() {
+               return Util::unwrap;
+        }
+        
+        @Deprecated
+        public static com.google.common.base.Function<ObjectAdapter, Object> 
get_Object() {
+            return new com.google.common.base.Function<ObjectAdapter, 
Object>() {
                 @Override
                 public Object apply(ObjectAdapter input) {
                     return Util.unwrap(input);
@@ -484,7 +488,12 @@ public interface ObjectAdapter extends Instance {
         }
         
         public static Function<Object, ObjectAdapter> adapterForUsing(final 
AdapterManager adapterManager) {
-            return new Function<Object, ObjectAdapter>() {
+               return adapterManager::adapterFor;
+        }
+        
+        @Deprecated
+        public static com.google.common.base.Function<Object, ObjectAdapter> 
adapter_ForUsing(final AdapterManager adapterManager) {
+            return new com.google.common.base.Function<Object, 
ObjectAdapter>() {
                 @Override
                 public ObjectAdapter apply(final Object pojo) {
                     return adapterManager.adapterFor(pojo);
diff --git 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventAbstract.java
 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventAbstract.java
index a2f609a..5f987d1 100644
--- 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventAbstract.java
+++ 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventAbstract.java
@@ -26,7 +26,6 @@ import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
-import java.util.concurrent.Callable;
 import java.util.function.Consumer;
 
 import org.apache.isis.applib.NonRecoverableException;
@@ -57,7 +56,6 @@ import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.consent.InteractionInitiatedBy;
 import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facetapi.IdentifiedHolder;
 import org.apache.isis.core.metamodel.facets.CollectionUtils;
 import org.apache.isis.core.metamodel.facets.DomainEventHelper;
 import org.apache.isis.core.metamodel.facets.ImperativeFacet;
@@ -74,7 +72,6 @@ import 
org.apache.isis.core.metamodel.services.publishing.PublishingServiceInter
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.spec.feature.Contributed;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
-import org.apache.isis.core.metamodel.specloader.ReflectiveActionException;
 import org.apache.isis.core.metamodel.specloader.specimpl.MixedInMember2;
 import org.apache.isis.core.runtime.system.transaction.TransactionalClosure;
 import org.apache.isis.schema.ixn.v1.ActionInvocationDto;
@@ -88,7 +85,8 @@ public abstract class 
ActionInvocationFacetForDomainEventAbstract
         extends ActionInvocationFacetAbstract
         implements ImperativeFacet {
 
-    private final static Logger LOG = 
LoggerFactory.getLogger(ActionInvocationFacetForDomainEventAbstract.class);
+    @SuppressWarnings("unused")
+       private final static Logger LOG = 
LoggerFactory.getLogger(ActionInvocationFacetForDomainEventAbstract.class);
 
     private final Method method;
     private final ObjectSpecification onType;
@@ -504,7 +502,7 @@ public abstract class 
ActionInvocationFacetForDomainEventAbstract
                             interactionInitiatedBy);
             final Object visibleObjects =
                     CollectionUtils.copyOf(
-                            Lists.transform(visibleAdapters, 
ObjectAdapter.Functions.getObject()),
+                            Lists.transform(visibleAdapters, 
ObjectAdapter.Functions.get_Object()),
                             method.getReturnType());
             if (visibleObjects != null) {
                 return 
getPersistenceSessionServiceInternal().adapterFor(visibleObjects);
diff --git 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/CommandUtil.java
 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/CommandUtil.java
index fcebbc4..dbbf1b8 100644
--- 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/CommandUtil.java
+++ 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/CommandUtil.java
@@ -19,12 +19,10 @@
 
 package org.apache.isis.core.metamodel.facets.actions.action.invocation;
 
-import java.util.Arrays;
 import java.util.List;
 
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-
+import org.apache.isis.applib.internal.base._NullSafe;
+import org.apache.isis.applib.internal.collections._Arrays;
 import org.apache.isis.applib.services.bookmark.Bookmark;
 import org.apache.isis.core.commons.lang.StringExtensions;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
@@ -103,13 +101,10 @@ public class CommandUtil {
         buf.append(name).append(": ").append(titleOf).append("\n");
     }
 
-
     public static ObjectAdapter[] adaptersFor(final Object[] args, final 
AdapterManager adapterManager) {
-        List<Object> argList = Arrays.asList(args);
-        Iterable<ObjectAdapter> adapterList = 
-                Iterables.transform(
-                        argList, 
ObjectAdapter.Functions.adapterForUsing(adapterManager));
-        return Lists.newArrayList(adapterList).toArray(new ObjectAdapter[]{});
+       return _NullSafe.stream(args)
+               .map(ObjectAdapter.Functions.adapterForUsing(adapterManager))
+               .collect(_Arrays.toArray(ObjectAdapter.class, 
_NullSafe.size(args)));
     }
 
 }
diff --git 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/accessor/CollectionAccessorFacetViaAccessor.java
 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/accessor/CollectionAccessorFacetViaAccessor.java
index ed8f80f..2644d7a 100644
--- 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/accessor/CollectionAccessorFacetViaAccessor.java
+++ 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/accessor/CollectionAccessorFacetViaAccessor.java
@@ -23,8 +23,7 @@ import java.lang.reflect.Method;
 import java.util.Collections;
 import java.util.List;
 
-import com.google.common.collect.Lists;
-
+import org.apache.isis.applib.internal.collections._Lists;
 import 
org.apache.isis.core.commons.authentication.AuthenticationSessionProvider;
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
@@ -87,7 +86,7 @@ public class CollectionAccessorFacetViaAccessor
                             interactionInitiatedBy);
             final Object visibleObjects =
                     CollectionUtils.copyOf(
-                            Lists.transform(visibleAdapters, 
ObjectAdapter.Functions.getObject()),
+                            _Lists.transform(visibleAdapters, 
ObjectAdapter.Functions.getObject()),
                             method.getReturnType());
             if (visibleObjects != null) {
                 return visibleObjects;
diff --git 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/javautilcollection/JavaCollectionFacet.java
 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/javautilcollection/JavaCollectionFacet.java
index c07b387..d56db8d 100644
--- 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/javautilcollection/JavaCollectionFacet.java
+++ 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/javautilcollection/JavaCollectionFacet.java
@@ -39,10 +39,12 @@ public class JavaCollectionFacet extends 
CollectionFacetAbstract {
     }
 
     @Override
-    @SuppressWarnings("unchecked")
     public Collection<ObjectAdapter> collection(final ObjectAdapter 
wrappedCollection) {
         final Collection<?> collectionOfUnderlying = 
collectionOfUnderlying(wrappedCollection);
-        return Collections2.transform(collectionOfUnderlying, 
ObjectAdapter.Functions.adapterForUsing(getAdapterManager()));
+        
+        //TODO [ahuber] java doc states, this is a live view, don't know if 
this is needed, or if a copy is sufficient
+        return Collections2.transform(collectionOfUnderlying, 
+                       
ObjectAdapter.Functions.adapter_ForUsing(getAdapterManager()));
     }
 
     @Override
diff --git 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/choices/ChoicesFacetFromBoundedAbstract.java
 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/choices/ChoicesFacetFromBoundedAbstract.java
index 3d80bb8..424e80f 100644
--- 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/choices/ChoicesFacetFromBoundedAbstract.java
+++ 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/choices/ChoicesFacetFromBoundedAbstract.java
@@ -21,12 +21,12 @@ package 
org.apache.isis.core.metamodel.facets.object.choices;
 
 import java.util.List;
 
-import com.google.common.collect.Lists;
-
-import org.apache.isis.applib.services.wrapper.events.UsabilityEvent;
-import org.apache.isis.applib.services.wrapper.events.ValidityEvent;
+import org.apache.isis.applib.internal.base._NullSafe;
+import org.apache.isis.applib.internal.collections._Arrays;
 import org.apache.isis.applib.query.Query;
 import org.apache.isis.applib.query.QueryFindAllInstances;
+import org.apache.isis.applib.services.wrapper.events.UsabilityEvent;
+import org.apache.isis.applib.services.wrapper.events.ValidityEvent;
 import org.apache.isis.core.commons.authentication.AuthenticationSession;
 import 
org.apache.isis.core.commons.authentication.AuthenticationSessionProvider;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
@@ -35,6 +35,7 @@ import 
org.apache.isis.core.metamodel.deployment.DeploymentCategory;
 import org.apache.isis.core.metamodel.facetapi.Facet;
 import org.apache.isis.core.metamodel.facetapi.FacetAbstract;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import 
org.apache.isis.core.metamodel.facets.object.domainobject.DomainObjectAnnotationFacetFactoryTest.Bounded;
 import org.apache.isis.core.metamodel.facets.objectvalue.choices.ChoicesFacet;
 import org.apache.isis.core.metamodel.interactions.DisablingInteractionAdvisor;
 import org.apache.isis.core.metamodel.interactions.ObjectValidityContext;
@@ -131,9 +132,10 @@ public abstract class ChoicesFacetFromBoundedAbstract
         final List<ObjectAdapter> adapters =
                 ObjectAdapter.Util.visibleAdapters(
                     allInstancesAdapter, interactionInitiatedBy);
-
-        final List<Object> pojos = Lists.transform(adapters, 
ObjectAdapter.Functions.getObject());
-        return Lists.newArrayList(pojos).toArray();
+        
+        return _NullSafe.stream(adapters)
+               .map(ObjectAdapter.Functions.getObject())
+               .collect(_Arrays.toArray(Object.class, 
_NullSafe.size(adapters)));
     }
 
     protected DeploymentCategory getDeploymentCategory() {
diff --git 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/autocomplete/method/ActionParameterAutoCompleteFacetViaMethod.java
 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/autocomplete/method/ActionParameterAutoCompleteFacetViaMethod.java
index 2858bd0..40dcbb3 100644
--- 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/autocomplete/method/ActionParameterAutoCompleteFacetViaMethod.java
+++ 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/autocomplete/method/ActionParameterAutoCompleteFacetViaMethod.java
@@ -23,10 +23,8 @@ import java.lang.reflect.Method;
 import java.util.Collections;
 import java.util.List;
 
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-
 import org.apache.isis.applib.internal._Constants;
+import org.apache.isis.applib.internal.collections._Lists;
 import 
org.apache.isis.core.commons.authentication.AuthenticationSessionProvider;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
@@ -99,8 +97,8 @@ public class ActionParameterAutoCompleteFacetViaMethod 
extends ActionParameterAu
                 ObjectAdapter.Util.visibleAdapters(
                         collectionAdapter,
                         interactionInitiatedBy);
-        final List<Object> visibleObjects = Lists.newArrayList(
-                Iterables.transform(visibleAdapters, 
ObjectAdapter.Functions.getObject()));
+        final List<Object> visibleObjects = 
+                       _Lists.transform(visibleAdapters, 
ObjectAdapter.Functions.getObject());
 
         final ObjectSpecification parameterSpec = 
getSpecification(parameterType);
         return CollectionUtils.getCollectionAsObjectArray(visibleObjects, 
parameterSpec, getAdapterManager());
diff --git 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/choices/method/ActionChoicesFacetViaMethod.java
 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/choices/method/ActionChoicesFacetViaMethod.java
index e1e90cb..c33a6ad 100644
--- 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/choices/method/ActionChoicesFacetViaMethod.java
+++ 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/choices/method/ActionChoicesFacetViaMethod.java
@@ -23,9 +23,7 @@ import java.lang.reflect.Method;
 import java.util.Collections;
 import java.util.List;
 
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-
+import org.apache.isis.applib.internal.collections._Lists;
 import org.apache.isis.core.commons.authentication.AuthenticationSession;
 import 
org.apache.isis.core.commons.authentication.AuthenticationSessionProvider;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
@@ -33,12 +31,12 @@ import 
org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
 import org.apache.isis.core.metamodel.consent.InteractionInitiatedBy;
 import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.CollectionUtils;
 import org.apache.isis.core.metamodel.facets.ImperativeFacet;
 import 
org.apache.isis.core.metamodel.facets.param.choices.ActionChoicesFacetAbstract;
 import org.apache.isis.core.metamodel.spec.DomainModelException;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
-import org.apache.isis.core.metamodel.facets.CollectionUtils;
 
 public class ActionChoicesFacetViaMethod extends ActionChoicesFacetAbstract 
implements ImperativeFacet {
 
@@ -118,8 +116,8 @@ public class ActionChoicesFacetViaMethod extends 
ActionChoicesFacetAbstract impl
                 ObjectAdapter.Util.visibleAdapters(
                         collectionAdapter,
                         interactionInitiatedBy);
-        final List<Object> filteredObjects = Lists.newArrayList(
-                Iterables.transform(visibleAdapters, 
ObjectAdapter.Functions.getObject()));
+        final List<Object> filteredObjects = 
+                       _Lists.transform(visibleAdapters, 
ObjectAdapter.Functions.getObject());
 
         final ObjectSpecification parameterSpec = 
getSpecification(parameterType);
         return CollectionUtils.getCollectionAsObjectArray(filteredObjects, 
parameterSpec, getAdapterManager());
diff --git 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/choices/methodnum/ActionParameterChoicesFacetViaMethod.java
 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/choices/methodnum/ActionParameterChoicesFacetViaMethod.java
index 66d503e..856550d 100644
--- 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/choices/methodnum/ActionParameterChoicesFacetViaMethod.java
+++ 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/choices/methodnum/ActionParameterChoicesFacetViaMethod.java
@@ -24,6 +24,7 @@ import java.util.Collections;
 import java.util.List;
 
 import org.apache.isis.applib.internal._Constants;
+import org.apache.isis.applib.internal.collections._Lists;
 import 
org.apache.isis.core.commons.authentication.AuthenticationSessionProvider;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
@@ -37,9 +38,6 @@ import 
org.apache.isis.core.metamodel.facets.param.choices.ActionParameterChoice
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
 
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-
 public class ActionParameterChoicesFacetViaMethod extends 
ActionParameterChoicesFacetAbstract implements ImperativeFacet {
 
     private final Method method;
@@ -91,8 +89,8 @@ public class ActionParameterChoicesFacetViaMethod extends 
ActionParameterChoices
                 ObjectAdapter.Util.visibleAdapters(
                         objectAdapter,
                         interactionInitiatedBy);
-        final List<Object> visibleObjects = Lists.newArrayList(
-                Iterables.transform(visibleAdapters, 
ObjectAdapter.Functions.getObject()));
+        final List<Object> visibleObjects = 
+                       _Lists.transform(visibleAdapters, 
ObjectAdapter.Functions.getObject());
 
         final ObjectSpecification parameterSpec = 
getSpecification(parameterType);
         return CollectionUtils.getCollectionAsObjectArray(visibleObjects, 
parameterSpec, getAdapterManager());
diff --git 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/autocomplete/method/PropertyAutoCompleteFacetMethod.java
 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/autocomplete/method/PropertyAutoCompleteFacetMethod.java
index 38a228d..2a5a582 100644
--- 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/autocomplete/method/PropertyAutoCompleteFacetMethod.java
+++ 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/autocomplete/method/PropertyAutoCompleteFacetMethod.java
@@ -26,6 +26,7 @@ import java.util.List;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Lists;
 
+import org.apache.isis.applib.internal.collections._Lists;
 import org.apache.isis.core.commons.authentication.AuthenticationSession;
 import 
org.apache.isis.core.commons.authentication.AuthenticationSessionProvider;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
@@ -98,7 +99,6 @@ public class PropertyAutoCompleteFacetMethod extends 
PropertyAutoCompleteFacetAb
         final AuthenticationSession authenticationSession = 
getAuthenticationSession();
         final DeploymentCategory deploymentCategory = getDeploymentCategory();
 
-
         final Object collectionOrArray = 
ObjectAdapter.InvokeUtils.invoke(method, owningAdapter, searchArg);
         if (collectionOrArray == null) {
             return null;
@@ -113,8 +113,8 @@ public class PropertyAutoCompleteFacetMethod extends 
PropertyAutoCompleteFacetAb
                 ObjectAdapter.Util.visibleAdapters(
                         collectionAdapter,
                         interactionInitiatedBy);
-        final List<Object> filteredObjects = Lists.newArrayList(
-                Iterables.transform(visibleAdapters, 
ObjectAdapter.Functions.getObject()));
+        final List<Object> filteredObjects = 
+                       _Lists.transform(visibleAdapters, 
ObjectAdapter.Functions.getObject());
 
         final ObjectSpecification propertySpec = 
getSpecification(propertyType);
         return CollectionUtils.getCollectionAsObjectArray(filteredObjects, 
propertySpec, getAdapterManager());
diff --git 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/bookmarks/BookmarkServiceInternalDefault.java
 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/bookmarks/BookmarkServiceInternalDefault.java
index ac4f089..771629d 100644
--- 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/bookmarks/BookmarkServiceInternalDefault.java
+++ 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/bookmarks/BookmarkServiceInternalDefault.java
@@ -201,7 +201,7 @@ public class BookmarkServiceInternalDefault implements 
BookmarkService, Serializ
 
        // -- HELPER
        
-    private final static Set<Class<? extends Serializable>> 
serializableFinalTypes = _Sets.unmodifiable(
+    private final static Set<Class<? extends Serializable>> 
serializableFinalTypes = _Sets.of(
                String.class,
                Boolean.class, boolean.class,
                Byte.class, byte.class,
@@ -212,7 +212,7 @@ public class BookmarkServiceInternalDefault implements 
BookmarkService, Serializ
                Double.class, double.class
     );
     
-    private final static List<Class<? extends Serializable>> serializableTypes 
= _Lists.unmodifiable(
+    private final static List<Class<? extends Serializable>> serializableTypes 
= _Lists.of(
                BigDecimal.class,
                BigInteger.class,
                java.util.Date.class,
diff --git 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/metamodel/MetaModelServiceDefault.java
 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/metamodel/MetaModelServiceDefault.java
index 49711f1..1d7e73b 100644
--- 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/metamodel/MetaModelServiceDefault.java
+++ 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/metamodel/MetaModelServiceDefault.java
@@ -201,7 +201,10 @@ public class MetaModelServiceDefault implements 
MetaModelService {
             return Sort.UNKNOWN;
         }
         throw new IllegalArgumentException(String.format(
-                "Unable to determine what sort of domain object is '%s'", 
objectSpec.getFullIdentifier()));
+                "Unable to determine what sort of domain object this is: '%s'. 
Originating domainType: '%s'", 
+                objectSpec.getFullIdentifier(),
+                domainType.getName()
+                       ));
     }
 
     @Override
diff --git 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToOneAssociationDefault.java
 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToOneAssociationDefault.java
index 864c3b9..f04c362 100644
--- 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToOneAssociationDefault.java
+++ 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToOneAssociationDefault.java
@@ -21,10 +21,10 @@ package org.apache.isis.core.metamodel.specloader.specimpl;
 
 import java.util.Collections;
 import java.util.List;
-
-import com.google.common.collect.Lists;
+import java.util.stream.Collectors;
 
 import org.apache.isis.applib.annotation.Where;
+import org.apache.isis.applib.internal.base._NullSafe;
 import org.apache.isis.applib.services.command.Command;
 import org.apache.isis.core.commons.exceptions.IsisException;
 import org.apache.isis.core.commons.util.ToString;
@@ -45,7 +45,6 @@ import 
org.apache.isis.core.metamodel.facets.properties.update.clear.PropertyCle
 import 
org.apache.isis.core.metamodel.facets.properties.update.init.PropertyInitializationFacet;
 import 
org.apache.isis.core.metamodel.facets.properties.update.modify.PropertySetterFacet;
 import org.apache.isis.core.metamodel.interactions.InteractionUtils;
-import org.apache.isis.core.metamodel.interactions.PropertyAccessContext;
 import org.apache.isis.core.metamodel.interactions.PropertyModifyContext;
 import org.apache.isis.core.metamodel.interactions.PropertyUsabilityContext;
 import org.apache.isis.core.metamodel.interactions.PropertyVisibilityContext;
@@ -153,14 +152,15 @@ public class OneToOneAssociationDefault extends 
ObjectAssociationAbstract implem
     }
 
     // REVIEW: UNUSED
-    private PropertyAccessContext createAccessInteractionContext(
-            final ObjectAdapter ownerAdapter,
-            final InteractionInitiatedBy interactionInitiatedBy) {
-        final ObjectAdapter referencedAdapter = get(ownerAdapter, 
interactionInitiatedBy);
-        return new PropertyAccessContext(
-                ownerAdapter, getIdentifier(), referencedAdapter, 
interactionInitiatedBy
-        );
-    }
+//TODO [ahuber] remove?    
+//    private PropertyAccessContext createAccessInteractionContext(
+//            final ObjectAdapter ownerAdapter,
+//            final InteractionInitiatedBy interactionInitiatedBy) {
+//        final ObjectAdapter referencedAdapter = get(ownerAdapter, 
interactionInitiatedBy);
+//        return new PropertyAccessContext(
+//                ownerAdapter, getIdentifier(), referencedAdapter, 
interactionInitiatedBy
+//        );
+//    }
 
     @Override
     public boolean isEmpty(final ObjectAdapter ownerAdapter, final 
InteractionInitiatedBy interactionInitiatedBy) {
@@ -284,8 +284,9 @@ public class OneToOneAssociationDefault extends 
ObjectAssociationAbstract implem
                 ownerAdapter,
                 getSpecificationLoader(),
                 interactionInitiatedBy);
-        List<ObjectAdapter> adapters = Lists.transform(
-                Lists.newArrayList(pojoOptions), 
ObjectAdapter.Functions.adapterForUsing(getPersistenceSessionService()));
+        List<ObjectAdapter> adapters = _NullSafe.stream(pojoOptions)
+                       .map( 
ObjectAdapter.Functions.adapterForUsing(getPersistenceSessionService()) )
+                       .collect(Collectors.toList());
         return adapters.toArray(new ObjectAdapter[]{});
     }
 
diff --git 
a/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
 
b/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
index 41947e9..5da7cc6 100644
--- 
a/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
+++ 
b/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
@@ -448,7 +448,7 @@ public class IsisWicketApplication
     }
 
     protected List<Future<Object>> startBackgroundInitializationThreads() {
-        return 
ThreadPoolSupport.getInstance().invokeAll(_Lists.<Callable<Object>>unmodifiable(
+        return 
ThreadPoolSupport.getInstance().invokeAll(_Lists.<Callable<Object>>of(
                        
                        Executors.callable(this::configureWebJars),
                        Executors.callable(this::configureWicketBootstrap),
diff --git 
a/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/mementos/ObjectAdapterMemento.java
 
b/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/mementos/ObjectAdapterMemento.java
index b164e3a..f2c7ea5 100644
--- 
a/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/mementos/ObjectAdapterMemento.java
+++ 
b/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/mementos/ObjectAdapterMemento.java
@@ -23,13 +23,10 @@ import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
+import java.util.function.Function;
 
 import javax.annotation.Nullable;
 
-import com.google.common.base.Function;
-import com.google.common.collect.FluentIterable;
-import com.google.common.collect.Lists;
-
 import org.apache.isis.applib.services.bookmark.Bookmark;
 import org.apache.isis.applib.services.hint.HintStore;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
@@ -48,6 +45,9 @@ import org.apache.isis.core.runtime.memento.Memento;
 import org.apache.isis.core.runtime.persistence.ObjectNotFoundException;
 import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
 
+import com.google.common.collect.FluentIterable;
+import com.google.common.collect.Lists;
+
 public class ObjectAdapterMemento implements Serializable {
 
     private static final long serialVersionUID = 1L;
@@ -136,7 +136,7 @@ public class ObjectAdapterMemento implements Serializable {
                 final List<Object> listOfPojos =
                         Lists.newArrayList(
                             FluentIterable.from(oam.list)
-                                           
.transform(Functions.toPojo(persistenceSession, specificationLoader))
+                                           
.transform(Functions.to_Pojo(persistenceSession, specificationLoader))
                                            .toList()
                         );
                 return 
ObjectAdapter.Functions.adapterForUsing(persistenceSession).apply(listOfPojos);
@@ -573,25 +573,40 @@ public class ObjectAdapterMemento implements Serializable 
{
         }
 
         public static Function<ObjectAction, ActionMemento> fromAction() {
-            return new Function<ObjectAction, ActionMemento>() {
+               return ActionMemento::new;
+        }
+        
+        @Deprecated
+        public static com.google.common.base.Function<ObjectAction, 
ActionMemento> from_Action() {
+            return new com.google.common.base.Function<ObjectAction, 
ActionMemento>() {
                 @Override
                 public ActionMemento apply(final ObjectAction from) {
                     return new ActionMemento(from);
                 }
             };
         }
-
+        
         public static Function<ObjectActionParameter, ActionParameterMemento> 
fromActionParameter() {
-            return new Function<ObjectActionParameter, 
ActionParameterMemento>() {
+               return ActionParameterMemento::new;
+        }
+
+        @Deprecated
+        public static com.google.common.base.Function<ObjectActionParameter, 
ActionParameterMemento> from_ActionParameter() {
+            return new com.google.common.base.Function<ObjectActionParameter, 
ActionParameterMemento>() {
                 @Override
                 public ActionParameterMemento apply(final 
ObjectActionParameter from) {
                     return new ActionParameterMemento(from);
                 }
             };
         }
-
+        
         public static Function<Object, ObjectAdapterMemento> fromPojo(final 
AdapterManager adapterManager) {
-            return new Function<Object, ObjectAdapterMemento>() {
+               return pojo->ObjectAdapterMemento.createOrNull( 
adapterManager.adapterFor(pojo) );
+        }
+        
+        @Deprecated
+        public static com.google.common.base.Function<Object, 
ObjectAdapterMemento> from_Pojo(final AdapterManager adapterManager) {
+            return new com.google.common.base.Function<Object, 
ObjectAdapterMemento>() {
                 @Override
                 public ObjectAdapterMemento apply(final Object pojo) {
                     final ObjectAdapter adapter = 
adapterManager.adapterFor(pojo);
@@ -599,22 +614,42 @@ public class ObjectAdapterMemento implements Serializable 
{
                 }
             };
         }
-
+        
         public static Function<ObjectAdapter, ObjectAdapterMemento> 
fromAdapter() {
-            return new Function<ObjectAdapter, ObjectAdapterMemento>() {
+               return ObjectAdapterMemento::createOrNull;
+        }
+
+        @Deprecated
+        public static com.google.common.base.Function<ObjectAdapter, 
ObjectAdapterMemento> from_Adapter() {
+            return new com.google.common.base.Function<ObjectAdapter, 
ObjectAdapterMemento>() {
                 @Override
                 public ObjectAdapterMemento apply(final ObjectAdapter adapter) 
{
                     return ObjectAdapterMemento.createOrNull(adapter);
                 }
             };
         }
-
-
+        
         public static Function<ObjectAdapterMemento, ObjectAdapter> 
fromMemento(
                 final ConcurrencyChecking concurrencyChecking,
                 final PersistenceSession persistenceSession,
                 final SpecificationLoader specificationLoader) {
-            return new Function<ObjectAdapterMemento, ObjectAdapter>() {
+               
+               return memento->{
+                        try {
+                     return memento.getObjectAdapter(concurrencyChecking, 
persistenceSession, specificationLoader);
+                 } catch (ObjectNotFoundException e) {
+                     // this can happen if for example the object is not 
visible (due to the security tenanted facet)
+                     return null;
+                 }
+               };
+       }
+
+        @Deprecated        
+        public static com.google.common.base.Function<ObjectAdapterMemento, 
ObjectAdapter> from_Memento(
+                final ConcurrencyChecking concurrencyChecking,
+                final PersistenceSession persistenceSession,
+                final SpecificationLoader specificationLoader) {
+            return new com.google.common.base.Function<ObjectAdapterMemento, 
ObjectAdapter>() {
                 @Override
                 public ObjectAdapter apply(final ObjectAdapterMemento memento) 
{
                     try {
@@ -626,9 +661,14 @@ public class ObjectAdapterMemento implements Serializable {
                 }
             };
         }
-
+        
         public static Function<ObjectAdapter, ObjectAdapterMemento> 
toMemento() {
-            return new Function<ObjectAdapter, ObjectAdapterMemento>() {
+           return ObjectAdapterMemento::createOrNull;
+        }
+
+        @Deprecated
+        public static com.google.common.base.Function<ObjectAdapter, 
ObjectAdapterMemento> to_Memento() {
+            return new com.google.common.base.Function<ObjectAdapter, 
ObjectAdapterMemento>() {
 
                 @Override
                 public ObjectAdapterMemento apply(ObjectAdapter from) {
@@ -637,11 +677,28 @@ public class ObjectAdapterMemento implements Serializable 
{
                 
             };
         }
-
+        
         public static Function<? super ObjectAdapterMemento, Object> toPojo(
                 final PersistenceSession persistenceSession,
                 final SpecificationLoader specificationLoader) {
-            return new Function<ObjectAdapterMemento, Object>() {
+               return input->{
+                        if(input == null) {
+                     return null;
+                 }
+                 final ObjectAdapter objectAdapter = input
+                         .getObjectAdapter(ConcurrencyChecking.NO_CHECK, 
persistenceSession, specificationLoader);
+                 if(objectAdapter == null) {
+                     return null;
+                 }
+                 return objectAdapter.getObject();
+               }; 
+        }
+
+        @Deprecated
+        public static com.google.common.base.Function<? super 
ObjectAdapterMemento, Object> to_Pojo(
+                final PersistenceSession persistenceSession,
+                final SpecificationLoader specificationLoader) {
+            return new com.google.common.base.Function<ObjectAdapterMemento, 
Object>() {
                 @Nullable @Override public Object apply(@Nullable final 
ObjectAdapterMemento input) {
                     if(input == null) {
                         return null;
@@ -657,7 +714,12 @@ public class ObjectAdapterMemento implements Serializable {
         }
 
         public static Function<ObjectAdapterMemento, RootOid> toOid() {
-            return new Function<ObjectAdapterMemento, RootOid>() {
+               return 
objectAdapterMemento->RootOid.create(objectAdapterMemento.asBookmark());
+        }
+        
+        @Deprecated
+        public static com.google.common.base.Function<ObjectAdapterMemento, 
RootOid> to_Oid() {
+            return new com.google.common.base.Function<ObjectAdapterMemento, 
RootOid>() {
                                 @Override
                                 public RootOid apply(final 
ObjectAdapterMemento objectAdapterMemento) {
                                     return 
RootOid.create(objectAdapterMemento.asBookmark());
diff --git 
a/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/ActionModel.java
 
b/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/ActionModel.java
index d25dc0b..a11cc3e 100644
--- 
a/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/ActionModel.java
+++ 
b/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/ActionModel.java
@@ -28,23 +28,11 @@ import java.util.Map.Entry;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import org.apache.wicket.request.IRequestHandler;
-import org.apache.wicket.request.handler.resource.ResourceStreamRequestHandler;
-import org.apache.wicket.request.http.handler.RedirectRequestHandler;
-import org.apache.wicket.request.mapper.parameter.PageParameters;
-import org.apache.wicket.request.resource.ContentDisposition;
-import org.apache.wicket.util.resource.AbstractResourceStream;
-import org.apache.wicket.util.resource.IResourceStream;
-import org.apache.wicket.util.resource.ResourceStreamNotFoundException;
-import org.apache.wicket.util.resource.StringResourceStream;
-
 import org.apache.isis.applib.Identifier;
 import org.apache.isis.applib.annotation.BookmarkPolicy;
 import org.apache.isis.applib.annotation.PromptStyle;
 import org.apache.isis.applib.annotation.Where;
+import org.apache.isis.applib.internal.collections._Lists;
 import org.apache.isis.applib.services.routing.RoutingService;
 import org.apache.isis.applib.value.Blob;
 import org.apache.isis.applib.value.Clob;
@@ -73,6 +61,18 @@ import 
org.apache.isis.viewer.wicket.model.mementos.ActionMemento;
 import org.apache.isis.viewer.wicket.model.mementos.ActionParameterMemento;
 import org.apache.isis.viewer.wicket.model.mementos.ObjectAdapterMemento;
 import org.apache.isis.viewer.wicket.model.mementos.PageParameterNames;
+import org.apache.wicket.request.IRequestHandler;
+import org.apache.wicket.request.handler.resource.ResourceStreamRequestHandler;
+import org.apache.wicket.request.http.handler.RedirectRequestHandler;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.request.resource.ContentDisposition;
+import org.apache.wicket.util.resource.AbstractResourceStream;
+import org.apache.wicket.util.resource.IResourceStream;
+import org.apache.wicket.util.resource.ResourceStreamNotFoundException;
+import org.apache.wicket.util.resource.StringResourceStream;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
 
 public class ActionModel extends BookmarkableModel<ObjectAdapter> implements 
FormExecutorContext {
 
@@ -648,7 +648,8 @@ public class ActionModel extends 
BookmarkableModel<ObjectAdapter> implements For
 
     
     private static List<ActionParameterMemento> buildParameterMementos(final 
List<ObjectActionParameter> parameters) {
-        final List<ActionParameterMemento> parameterMementoList = 
Lists.transform(parameters, 
ObjectAdapterMemento.Functions.fromActionParameter());
+        final List<ActionParameterMemento> parameterMementoList =
+                       _Lists.transform(parameters, 
ObjectAdapterMemento.Functions.fromActionParameter());
         // we copy into a new array list otherwise we get lazy evaluation =
         // reference to a non-serializable object
         return Lists.newArrayList(parameterMementoList);
diff --git 
a/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityCollectionModel.java
 
b/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityCollectionModel.java
index 934684f..63b77b3 100644
--- 
a/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityCollectionModel.java
+++ 
b/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityCollectionModel.java
@@ -25,8 +25,12 @@ import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
+import org.apache.isis.applib.internal.base._Casts;
 import org.apache.isis.applib.internal.base._NullSafe;
+import org.apache.isis.applib.internal.collections._Lists;
 import org.apache.isis.applib.layout.component.CollectionLayoutData;
 import org.apache.isis.core.commons.factory.InstanceUtil;
 import org.apache.isis.core.commons.lang.ClassUtil;
@@ -48,13 +52,9 @@ import 
org.apache.isis.viewer.wicket.model.links.LinkAndLabel;
 import org.apache.isis.viewer.wicket.model.links.LinksProvider;
 import org.apache.isis.viewer.wicket.model.mementos.CollectionMemento;
 import org.apache.isis.viewer.wicket.model.mementos.ObjectAdapterMemento;
+import 
org.apache.isis.viewer.wicket.model.models.Util.LowestCommonSuperclassFinder;
 import org.apache.wicket.Component;
 
-import com.google.common.base.Predicates;
-import com.google.common.collect.FluentIterable;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-
 /**
  * Model representing a collection of entities, either {@link Type#STANDALONE
  * standalone} (eg result of invoking an action) or {@link Type#PARENTED
@@ -90,40 +90,41 @@ public class EntityCollectionModel extends 
ModelAbstract<List<ObjectAdapter>> im
                 final Iterable<ObjectAdapter> values = bulkLoad
                                 ? loadInBulk(entityCollectionModel)
                                 : loadOneByOne(entityCollectionModel);
-                return Lists.newArrayList(values);
+                return _Lists.newArrayList(values);
             }
 
             private Iterable<ObjectAdapter> loadInBulk(final 
EntityCollectionModel model) {
-                final List<ObjectAdapterMemento> mementoList = 
model.mementoList;
 
                 final PersistenceSession persistenceSession = 
model.getPersistenceSession();
-
-                final List<RootOid> rootOids = FluentIterable.from(mementoList)
-                        
.transform(ObjectAdapterMemento.Functions.toOid()).toList();
+                
+                final List<RootOid> rootOids = 
_NullSafe.stream(model.mementoList)
+                               .map(ObjectAdapterMemento.Functions.toOid())
+                               .collect(Collectors.toList());
 
                 final Map<RootOid, ObjectAdapter> adaptersByOid = 
persistenceSession.adaptersFor(rootOids);
                 final Collection<ObjectAdapter> adapterList = 
adaptersByOid.values();
-                return FluentIterable.from(adapterList)
-                        .filter(Predicates.<ObjectAdapter>notNull());
+                return _NullSafe.stream(adapterList)
+                               .filter(_NullSafe::isPresent)
+                       .collect(Collectors.toList());
             }
 
             private Iterable<ObjectAdapter> loadOneByOne(final 
EntityCollectionModel model) {
-                final List<ObjectAdapterMemento> mementoList = 
model.mementoList;
-                return FluentIterable.from(mementoList)
-                            .transform(
-                                ObjectAdapterMemento.Functions.fromMemento(
+                return _NullSafe.stream(model.mementoList)
+                       .map(ObjectAdapterMemento.Functions.fromMemento(
                                         ConcurrencyChecking.NO_CHECK,
                                         model.getPersistenceSession(),
                                         model.getSpecificationLoader()))
-                            .filter(Predicates.notNull());
+                       .filter(_NullSafe::isPresent)
+                       .collect(Collectors.toList());
             }
 
             @Override
             void setObject(final EntityCollectionModel entityCollectionModel, 
final List<ObjectAdapter> list) {
-                entityCollectionModel.mementoList = Lists.newArrayList(
-                        Iterables.filter(
-                                Iterables.transform(list, 
ObjectAdapterMemento.Functions.toMemento()),
-                                Predicates.<ObjectAdapterMemento>notNull()));
+               
+               entityCollectionModel.mementoList = _NullSafe.stream(list)
+                       .map(ObjectAdapterMemento.Functions.toMemento())
+                       .filter(_NullSafe::isPresent)
+                       .collect(Collectors.toList());
             }
 
             @Override
@@ -154,11 +155,14 @@ public class EntityCollectionModel extends 
ModelAbstract<List<ObjectAdapter>> im
         PARENTED {
             @Override
             List<ObjectAdapter> load(final EntityCollectionModel 
entityCollectionModel) {
+               
                 final ObjectAdapter adapter = 
entityCollectionModel.getParentObjectAdapterMemento().getObjectAdapter(
                         ConcurrencyChecking.NO_CHECK, 
entityCollectionModel.getPersistenceSession(),
                         entityCollectionModel.getSpecificationLoader());
+                
                 final OneToManyAssociation collection = 
entityCollectionModel.collectionMemento.getCollection(
                         entityCollectionModel.getSpecificationLoader());
+                
                 final ObjectAdapter collectionAsAdapter = 
collection.get(adapter, InteractionInitiatedBy.USER);
 
                 final List<Object> objectList = 
asIterable(collectionAsAdapter);
@@ -171,8 +175,9 @@ public class EntityCollectionModel extends 
ModelAbstract<List<ObjectAdapter>> im
                     Collections.sort(objectList, comparator);
                 }
 
-                final Iterable<ObjectAdapter> adapterIterable = 
Iterables.transform(objectList, ObjectAdapter.Functions.adapterForUsing( 
entityCollectionModel.getPersistenceSession()));
-                final List<ObjectAdapter> adapterList = 
Lists.newArrayList(adapterIterable);
+                final List<ObjectAdapter> adapterList = 
_NullSafe.stream(objectList)
+                       .map(ObjectAdapter.Functions.adapterForUsing( 
entityCollectionModel.getPersistenceSession() )) 
+                       .collect(Collectors.toList());
 
                 return adapterList;
             }
@@ -180,7 +185,7 @@ public class EntityCollectionModel extends 
ModelAbstract<List<ObjectAdapter>> im
             @SuppressWarnings("unchecked")
             private List<Object> asIterable(final ObjectAdapter 
collectionAsAdapter) {
                 final Iterable<Object> objects = (Iterable<Object>) 
collectionAsAdapter.getObject();
-                return Lists.newArrayList(objects);
+                return _Lists.newArrayList(objects);
             }
 
             @Override
@@ -221,30 +226,7 @@ public class EntityCollectionModel extends 
ModelAbstract<List<ObjectAdapter>> im
 
         public abstract EntityModel.RenderingHint renderingHint();
     }
-
-    static class LowestCommonSuperclassFinder {
-        private Class<?> common;
-        
-        public void collect(final Class<?> value) {
-            if(common == null) {
-                common = value;
-            } else {
-                Class<?> current = common;
-                while(!current.isAssignableFrom(value)) {
-                    current = current.getSuperclass();
-                }
-                common = current;
-            }
-        }
-        Class<?> getLowestCommonSuperclass() { 
-            return common; 
-        }
-               void searchThrough(Iterable<?> list) {
-                       _NullSafe.stream(list)
-            .map(Object::getClass)
-            .forEach(this::collect);
-               }
-    }
+    
 
     /**
      * Factory.
@@ -252,26 +234,22 @@ public class EntityCollectionModel extends 
ModelAbstract<List<ObjectAdapter>> im
     public static EntityCollectionModel createStandalone(
             final ObjectAdapter collectionAsAdapter,
             final IsisSessionFactory sessionFactory) {
-        final Iterable<Object> pojos = 
EntityCollectionModel.asIterable(collectionAsAdapter);
-
-        final List<ObjectAdapterMemento> mementoList =
-                Lists.newArrayList(Iterables.transform(pojos, 
ObjectAdapterMemento.Functions.fromPojo(
-                        
sessionFactory.getCurrentSession().getPersistenceSession())));
-
-        final ObjectSpecification elementSpec;
-        if(!Iterables.isEmpty(pojos)) {
-            // dynamically determine the spec of the elements
-            // (ie so a List<Object> can be rendered according to the runtime 
type of its elements, 
-            // rather than the compile-time type
-            final LowestCommonSuperclassFinder finder = new 
LowestCommonSuperclassFinder();
-            
-            finder.searchThrough(pojos);
-            
-            elementSpec = sessionFactory.getSpecificationLoader()
-                       .loadSpecification(finder.getLowestCommonSuperclass());
-        } else {
-            elementSpec = collectionAsAdapter.getElementSpecification();
-        }
+       
+       final PersistenceSession persistenceSession = 
sessionFactory.getCurrentSession().getPersistenceSession();
+       
+       // dynamically determine the spec of the elements
+        // (ie so a List<Object> can be rendered according to the runtime type 
of its elements, 
+        // rather than the compile-time type
+        final LowestCommonSuperclassFinder lowestCommonSuperclassFinder = new 
LowestCommonSuperclassFinder();
+       
+       final List<ObjectAdapterMemento> mementoList = 
streamElementsOf(collectionAsAdapter) // pojos
+               .peek(lowestCommonSuperclassFinder::collect)
+                       
.map(ObjectAdapterMemento.Functions.fromPojo(persistenceSession))
+               .collect(Collectors.toList());
+
+        final ObjectSpecification elementSpec = 
lowestCommonSuperclassFinder.getLowestCommonSuperclass()
+                       
.map(sessionFactory.getSpecificationLoader()::loadSpecification)
+                       .orElse(collectionAsAdapter.getElementSpecification());
 
         final Class<?> elementType;
         int pageSize = PAGE_SIZE_DEFAULT_FOR_STANDALONE;
@@ -348,7 +326,7 @@ public class EntityCollectionModel extends 
ModelAbstract<List<ObjectAdapter>> im
     /**
      * Additional links to render (if any)
      */
-    private List<LinkAndLabel> linkAndLabels = Lists.newArrayList();
+    private List<LinkAndLabel> linkAndLabels = _Lists.newArrayList();
 
     /**
      * Optionally populated only if {@link Type#PARENTED}.
@@ -366,7 +344,7 @@ public class EntityCollectionModel extends 
ModelAbstract<List<ObjectAdapter>> im
         this.typeOf = typeOf;
         this.mementoList = mementoList;
         this.pageSize = pageSize;
-        this.toggledMementosList = Lists.newArrayList();
+        this.toggledMementosList = _Lists.newArrayList();
     }
 
     private EntityCollectionModel(final EntityModel entityModel) {
@@ -383,7 +361,7 @@ public class EntityCollectionModel extends 
ModelAbstract<List<ObjectAdapter>> im
         final SortedByFacet sortedByFacet = 
collection.getFacet(SortedByFacet.class);
         this.sortedBy = sortedByFacet != null ? sortedByFacet.value(): null;
 
-        this.toggledMementosList = Lists.newArrayList();
+        this.toggledMementosList = _Lists.newArrayList();
     }
     
 
@@ -469,9 +447,9 @@ public class EntityCollectionModel extends 
ModelAbstract<List<ObjectAdapter>> im
      * Not API, but to refresh the model list.
      */
     public void setObjectList(ObjectAdapter resultAdapter) {
-        final Iterable<Object> pojos = 
EntityCollectionModel.asIterable(resultAdapter);
-        this.mementoList = Lists.newArrayList(
-                Iterables.transform(pojos, 
ObjectAdapterMemento.Functions.fromPojo(getPersistenceSession())));
+       this.mementoList = streamElementsOf(resultAdapter)
+               
.map(ObjectAdapterMemento.Functions.fromPojo(getPersistenceSession()))
+                       .collect(Collectors.toList());
     }
 
     /**
@@ -495,11 +473,14 @@ public class EntityCollectionModel extends 
ModelAbstract<List<ObjectAdapter>> im
         return collectionMemento;
     }
 
-    @SuppressWarnings("unchecked")
     private static Iterable<Object> asIterable(final ObjectAdapter 
resultAdapter) {
-        return (Iterable<Object>) resultAdapter.getObject();
+        return _Casts.uncheckedCast(resultAdapter.getObject());
     }
 
+    private static Stream<Object> streamElementsOf(final ObjectAdapter 
resultAdapter) {
+        return _NullSafe.stream(asIterable(resultAdapter));
+    }
+    
     
     public void toggleSelectionOn(ObjectAdapter selectedAdapter) {
         ObjectAdapterMemento selectedAsMemento = 
ObjectAdapterMemento.createOrNull(selectedAdapter);
@@ -512,7 +493,7 @@ public class EntityCollectionModel extends 
ModelAbstract<List<ObjectAdapter>> im
     }
     
     public List<ObjectAdapterMemento> getToggleMementosList() {
-        return 
Collections.unmodifiableList(Lists.newArrayList(this.toggledMementosList));
+        return 
Collections.unmodifiableList(_Lists.newArrayList(this.toggledMementosList));
     }
 
     public void clearToggleMementosList() {
diff --git 
a/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/ScalarModel.java
 
b/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/ScalarModel.java
index fe52635..64be5e7 100644
--- 
a/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/ScalarModel.java
+++ 
b/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/ScalarModel.java
@@ -24,12 +24,11 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
-
-import com.google.common.collect.FluentIterable;
-import com.google.common.collect.Lists;
+import java.util.stream.Collectors;
 
 import org.apache.isis.applib.annotation.PromptStyle;
 import org.apache.isis.applib.annotation.Where;
+import org.apache.isis.applib.internal.base._NullSafe;
 import org.apache.isis.core.commons.authentication.AuthenticationSession;
 import 
org.apache.isis.core.commons.authentication.AuthenticationSessionProvider;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
@@ -61,6 +60,8 @@ import 
org.apache.isis.viewer.wicket.model.mementos.ObjectAdapterMemento;
 import org.apache.isis.viewer.wicket.model.mementos.PropertyMemento;
 import org.apache.isis.viewer.wicket.model.mementos.SpecUtils;
 
+import com.google.common.collect.Lists;
+
 /**
  * Represents a scalar of an entity, either a {@link Kind#PROPERTY property} or
  * a {@link Kind#PARAMETER parameter}.
@@ -780,12 +781,15 @@ public class ScalarModel extends EntityModel implements 
LinksProvider,FormExecut
 
     public boolean isScalarTypeAnyOf(final Class<?>... requiredClass) {
         final String fullName = getTypeOfSpecification().getFullIdentifier();
-        for (final Class<?> requiredCls : requiredClass) {
-            if (fullName.equals(requiredCls.getName())) {
-                return true;
-            }
-        }
-        return false;
+        return _NullSafe.stream(requiredClass)
+                       .map(Class::getName)
+                       .anyMatch(fullName::equals);
+    }
+    
+    public boolean isScalarTypeSubtypingAnyOf(final Class<?>... requiredClass) 
{
+        final Class<?> scalarType = 
getTypeOfSpecification().getCorrespondingClass();
+        return _NullSafe.stream(requiredClass)
+                       .anyMatch(scalarType::isAssignableFrom);
     }
 
     public String getObjectAsString() {
@@ -810,11 +814,9 @@ public class ScalarModel extends EntityModel implements 
LinksProvider,FormExecut
         }
 
         if(isCollection()) {
-            final Iterable<?> iterable = (Iterable<?>) pojo;
-            final ArrayList<ObjectAdapterMemento> listOfMementos =
-                    Lists.newArrayList(FluentIterable.from(iterable)
-                          
.transform(ObjectAdapterMemento.Functions.fromPojo(getPersistenceSession()))
-                    .toList());
+            final List<ObjectAdapterMemento> listOfMementos = 
_NullSafe.stream((Iterable<?>) pojo)
+                       
.map(ObjectAdapterMemento.Functions.fromPojo(getPersistenceSession()))
+                       .collect(Collectors.toList());
             final ObjectAdapterMemento memento =
                     ObjectAdapterMemento.createForList(listOfMementos, 
getTypeOfSpecification().getSpecId());
             super.setObjectMemento(memento, getPersistenceSession(), 
getSpecificationLoader()); // associated value
diff --git 
a/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/Util.java
 
b/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/Util.java
new file mode 100644
index 0000000..ce0c86b
--- /dev/null
+++ 
b/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/Util.java
@@ -0,0 +1,28 @@
+package org.apache.isis.viewer.wicket.model.models;
+
+import java.util.Optional;
+
+import org.apache.isis.applib.internal.base._Reduction;
+
+class Util {
+
+       final static class LowestCommonSuperclassFinder {
+
+               private final _Reduction<Class<?>> reduction = 
_Reduction.of((common, next) -> {
+                       Class<?> refine = common;
+                       while(!refine.isAssignableFrom(next)) {
+                               refine = refine.getSuperclass();
+                       }
+                       return refine;
+               });
+
+               public void collect(Object pojo) {
+                       reduction.accept(pojo.getClass());
+               }
+
+               public Optional<Class<?>> getLowestCommonSuperclass() {
+                       return reduction.getResult();
+               }
+       }
+
+}
diff --git 
a/core/viewer-wicket-model/src/test/java/org/apache/isis/viewer/wicket/model/models/LowestCommonSuperclassClosureTest.java
 
b/core/viewer-wicket-model/src/test/java/org/apache/isis/viewer/wicket/model/models/LowestCommonSuperclassClosureTest.java
index 4114cda..e21da91 100644
--- 
a/core/viewer-wicket-model/src/test/java/org/apache/isis/viewer/wicket/model/models/LowestCommonSuperclassClosureTest.java
+++ 
b/core/viewer-wicket-model/src/test/java/org/apache/isis/viewer/wicket/model/models/LowestCommonSuperclassClosureTest.java
@@ -19,14 +19,13 @@
 
 package org.apache.isis.viewer.wicket.model.models;
 
+import static org.junit.Assert.assertThat;
+
 import java.util.Arrays;
 import java.util.List;
 
-import org.junit.Test;
-
 import org.apache.isis.core.commons.matchers.IsisMatchers;
-
-import static org.junit.Assert.assertThat;
+import org.junit.Test;
 
 public class LowestCommonSuperclassClosureTest {
 
@@ -52,10 +51,10 @@ public class LowestCommonSuperclassClosureTest {
     }
     
     private static void assertLowestCommonOfListIs(List<Object> list, Class<?> 
expected) {
-        EntityCollectionModel.LowestCommonSuperclassFinder finder = 
-                       new 
EntityCollectionModel.LowestCommonSuperclassFinder();
-        finder.searchThrough(list);
-        assertThat(finder.getLowestCommonSuperclass(), 
IsisMatchers.classEqualTo(expected));
+        Util.LowestCommonSuperclassFinder finder = 
+                       new Util.LowestCommonSuperclassFinder();
+        list.forEach(finder::collect);
+        assertThat(finder.getLowestCommonSuperclass().get(), 
IsisMatchers.classEqualTo(expected));
     }
 
 
diff --git 
a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsLinkFactory.java
 
b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsLinkFactory.java
index b4e6e09..f990a83 100644
--- 
a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsLinkFactory.java
+++ 
b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsLinkFactory.java
@@ -19,17 +19,12 @@
 package org.apache.isis.viewer.wicket.ui.components.collection.bulk;
 
 import java.util.List;
-
-import com.google.common.base.Predicate;
-import com.google.common.collect.FluentIterable;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-
-import org.apache.wicket.markup.html.link.AbstractLink;
-import org.apache.wicket.markup.html.link.Link;
+import java.util.stream.Collectors;
 
 import org.apache.isis.applib.RecoverableException;
 import org.apache.isis.applib.annotation.InvokedOn;
+import org.apache.isis.applib.internal.base._NullSafe;
+import org.apache.isis.applib.internal.collections._Lists;
 import org.apache.isis.applib.services.actinvoc.ActionInvocationContext;
 import org.apache.isis.applib.services.command.Command;
 import org.apache.isis.applib.services.command.Command.Executor;
@@ -57,6 +52,12 @@ import 
org.apache.isis.viewer.wicket.ui.actionresponse.ActionResultResponseType;
 import 
org.apache.isis.viewer.wicket.ui.components.collectioncontents.ajaxtable.columns.ObjectAdapterToggleboxColumn;
 import 
org.apache.isis.viewer.wicket.ui.components.widgets.linkandlabel.ActionLinkFactory;
 import org.apache.isis.viewer.wicket.ui.errors.JGrowlBehaviour;
+import org.apache.wicket.markup.html.link.AbstractLink;
+import org.apache.wicket.markup.html.link.Link;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
 
 public final class BulkActionsLinkFactory implements ActionLinkFactory {
 
@@ -94,17 +95,13 @@ public final class BulkActionsLinkFactory implements 
ActionLinkFactory {
                         
ConcurrencyChecking.concurrencyCheckingFor(objectAction.getSemantics());
 
                 try {
-                    final List<ObjectAdapterMemento> toggleMementosList = 
model.getToggleMementosList();
-
-                    final List<ObjectAdapter> toggledAdapters =
-                            FluentIterable.from(toggleMementosList)
-                            .transform(
-                                    ObjectAdapterMemento.Functions.fromMemento(
-                                            concurrencyChecking, 
getPersistenceSession(), getSpecificationLoader()))
-                                    .toList();
-
-                    final List<Object> domainObjects = 
Lists.newArrayList(Iterables.transform(toggledAdapters, 
ObjectAdapter.Functions.getObject()));
+                    final List<ObjectAdapter> toggledAdapters = 
_NullSafe.stream(model.getToggleMementosList())
+                           .map(ObjectAdapterMemento.Functions.fromMemento(
+                                   concurrencyChecking, 
getPersistenceSession(), getSpecificationLoader()))
+                           .collect(Collectors.toList());
 
+                    final List<Object> domainObjects = 
+                               _Lists.transform(toggledAdapters, 
ObjectAdapter.Functions.getObject());
 
                     final ActionInvocationContext actionInvocationContext = 
getServicesInjector().lookupService(ActionInvocationContext.class);
                     if (actionInvocationContext != null) {
@@ -112,8 +109,6 @@ public final class BulkActionsLinkFactory implements 
ActionLinkFactory {
                         
actionInvocationContext.setDomainObjects(domainObjects);
                     }
 
-
-
                     ObjectAdapter lastReturnedAdapter = null;
                     int i=0;
                     for(final ObjectAdapter adapter : toggledAdapters) {
diff --git 
a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/reference/ReferencePanel.java
 
b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/reference/ReferencePanel.java
index 295aeff..8d82c0f 100644
--- 
a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/reference/ReferencePanel.java
+++ 
b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/reference/ReferencePanel.java
@@ -21,20 +21,7 @@ package 
org.apache.isis.viewer.wicket.ui.components.scalars.reference;
 
 import java.util.List;
 
-import com.google.common.collect.Lists;
-
-import org.apache.wicket.AttributeModifier;
-import org.apache.wicket.Component;
-import org.apache.wicket.MarkupContainer;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.html.form.FormComponent;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.Model;
-import org.wicketstuff.select2.ChoiceProvider;
-import org.wicketstuff.select2.Settings;
-
+import org.apache.isis.applib.internal.collections._Lists;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import 
org.apache.isis.core.metamodel.adapter.mgr.AdapterManager.ConcurrencyChecking;
 import 
org.apache.isis.core.metamodel.facets.object.autocomplete.AutoCompleteFacet;
@@ -57,6 +44,19 @@ import 
org.apache.isis.viewer.wicket.ui.components.widgets.select2.providers.Obj
 import 
org.apache.isis.viewer.wicket.ui.components.widgets.select2.providers.ObjectAdapterMementoProviderForReferenceParamOrPropertyAutoComplete;
 import org.apache.isis.viewer.wicket.ui.util.Components;
 import org.apache.isis.viewer.wicket.ui.util.CssClassAppender;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.Component;
+import org.apache.wicket.MarkupContainer;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.FormComponent;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.wicketstuff.select2.ChoiceProvider;
+import org.wicketstuff.select2.Settings;
+
+import com.google.common.collect.Lists;
 
 /**
  * Panel for rendering scalars which of are of reference type (as opposed to
@@ -73,7 +73,8 @@ public class ReferencePanel extends 
ScalarPanelSelect2Abstract implements PanelW
     /**
      * Determines the behaviour of dependent choices for the dependent; either 
to autoselect the first available choice, or to select none.
      */
-    private static final String KEY_DISABLE_DEPENDENT_CHOICE_AUTO_SELECTION = 
"isis.viewer.wicket.disableDependentChoiceAutoSelection";
+    //TODO [ahuber] not used, remove?
+    //private static final String KEY_DISABLE_DEPENDENT_CHOICE_AUTO_SELECTION 
= "isis.viewer.wicket.disableDependentChoiceAutoSelection";
 
     private EntityLinkSelect2Panel entityLink;
 
@@ -171,7 +172,9 @@ public class ReferencePanel extends 
ScalarPanelSelect2Abstract implements PanelW
     protected IModel<String> obtainInlinePromptModel() {
         final IModel<ObjectAdapterMemento> model = select2.getModel();
         return new IModel<String>() {
-            @Override
+                       private static final long serialVersionUID = 1L;
+
+                       @Override
             public String getObject() {
                 final ObjectAdapterMemento oam = model.getObject();
                 if(oam == null) {
@@ -350,8 +353,7 @@ public class ReferencePanel extends 
ScalarPanelSelect2Abstract implements PanelW
         if(getModel().hasChoices()) {
             choices.addAll(getModel().getChoices(argsIfAvailable, 
getAuthenticationSession(), getDeploymentCategory()));
         }
-        // take a copy (otherwise is only lazily evaluated)
-        return Lists.newArrayList(Lists.transform(choices, 
ObjectAdapterMemento.Functions.fromAdapter()));
+        return _Lists.transform(choices, 
ObjectAdapterMemento.Functions.fromAdapter());
     }
 
     // called by setProviderAndCurrAndPending
@@ -368,12 +370,13 @@ public class ReferencePanel extends 
ScalarPanelSelect2Abstract implements PanelW
 
         }
     }
-
-    private boolean autoSelect() {
-        final boolean disableAutoSelect = 
getConfiguration().getBoolean(KEY_DISABLE_DEPENDENT_CHOICE_AUTO_SELECTION, 
false);
-        final boolean autoSelect = !disableAutoSelect;
-        return autoSelect;
-    }
+    
+//TODO [ahuber ]not used, remove? 
+//    private boolean autoSelect() {
+//        final boolean disableAutoSelect = 
getConfiguration().getBoolean(KEY_DISABLE_DEPENDENT_CHOICE_AUTO_SELECTION, 
false);
+//        final boolean autoSelect = !disableAutoSelect;
+//        return autoSelect;
+//    }
 
     // //////////////////////////////////////
     // getInput, convertInput
diff --git 
a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/valuechoices/ValueChoicesSelect2Panel.java
 
b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/valuechoices/ValueChoicesSelect2Panel.java
index defe635..73a2b5c 100644
--- 
a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/valuechoices/ValueChoicesSelect2Panel.java
+++ 
b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/valuechoices/ValueChoicesSelect2Panel.java
@@ -18,17 +18,7 @@ package 
org.apache.isis.viewer.wicket.ui.components.scalars.valuechoices;
 
 import java.util.List;
 
-import com.google.common.collect.Lists;
-
-import org.apache.wicket.AttributeModifier;
-import org.apache.wicket.Component;
-import org.apache.wicket.MarkupContainer;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.html.form.FormComponent;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.Model;
-import org.wicketstuff.select2.ChoiceProvider;
-
+import org.apache.isis.applib.internal.collections._Lists;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.viewer.wicket.model.isis.WicketViewerSettings;
 import org.apache.isis.viewer.wicket.model.mementos.ObjectAdapterMemento;
@@ -37,6 +27,14 @@ import 
org.apache.isis.viewer.wicket.ui.components.scalars.PanelWithChoices;
 import 
org.apache.isis.viewer.wicket.ui.components.scalars.ScalarPanelSelect2Abstract;
 import org.apache.isis.viewer.wicket.ui.components.widgets.select2.Select2;
 import 
org.apache.isis.viewer.wicket.ui.components.widgets.select2.providers.ObjectAdapterMementoProviderForValueChoices;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.Component;
+import org.apache.wicket.MarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.FormComponent;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.wicketstuff.select2.ChoiceProvider;
 
 public class ValueChoicesSelect2Panel extends ScalarPanelSelect2Abstract 
implements PanelWithChoices {
 
@@ -75,8 +73,7 @@ public class ValueChoicesSelect2Panel extends 
ScalarPanelSelect2Abstract impleme
         final List<ObjectAdapter> choices =
                 scalarModel.getChoices(argumentsIfAvailable, 
getAuthenticationSession(), getDeploymentCategory());
         
-        // take a copy otherwise is only lazily evaluated
-        return Lists.newArrayList(Lists.transform(choices, 
ObjectAdapterMemento.Functions.fromAdapter()));
+        return _Lists.transform(choices, 
ObjectAdapterMemento.Functions.fromAdapter());
     }
 
     // ///////////////////////////////////////////////////////////////////
diff --git 
a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/select2/providers/ObjectAdapterMementoProviderForReferenceObjectAutoComplete.java
 
b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/select2/providers/ObjectAdapterMementoProviderForReferenceObjectAutoComplete.java
index 389a1d6..e85d498 100644
--- 
a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/select2/providers/ObjectAdapterMementoProviderForReferenceObjectAutoComplete.java
+++ 
b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/select2/providers/ObjectAdapterMementoProviderForReferenceObjectAutoComplete.java
@@ -39,10 +39,7 @@ package 
org.apache.isis.viewer.wicket.ui.components.widgets.select2.providers;
 import java.util.Collection;
 import java.util.List;
 
-import com.google.common.base.Function;
-import com.google.common.collect.Collections2;
-import com.google.common.collect.Lists;
-
+import org.apache.isis.applib.internal.collections._Lists;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.oid.RootOid;
 import org.apache.isis.core.metamodel.consent.InteractionInitiatedBy;
@@ -52,6 +49,10 @@ import 
org.apache.isis.viewer.wicket.model.isis.WicketViewerSettings;
 import org.apache.isis.viewer.wicket.model.mementos.ObjectAdapterMemento;
 import org.apache.isis.viewer.wicket.model.models.ScalarModel;
 
+import com.google.common.base.Function;
+import com.google.common.collect.Collections2;
+import com.google.common.collect.Lists;
+
 public class ObjectAdapterMementoProviderForReferenceObjectAutoComplete
         extends ObjectAdapterMementoProviderAbstract {
 
@@ -70,9 +71,7 @@ public class 
ObjectAdapterMementoProviderForReferenceObjectAutoComplete
         final List<ObjectAdapter> autoCompleteAdapters =
                 autoCompleteFacet.execute(term,
                         InteractionInitiatedBy.USER);
-        // take a copy otherwise so is eagerly evaluated and memento objects 
correctly built
-        return Lists.newArrayList(
-                Lists.transform(autoCompleteAdapters, 
ObjectAdapterMemento.Functions.fromAdapter()));
+        return _Lists.transform(autoCompleteAdapters, 
ObjectAdapterMemento.Functions.fromAdapter());
     }
 
     @Override
diff --git 
a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/select2/providers/ObjectAdapterMementoProviderForReferenceParamOrPropertyAutoComplete.java
 
b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/select2/providers/ObjectAdapterMementoProviderForReferenceParamOrPropertyAutoComplete.java
index dd96f20..9307738 100644
--- 
a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/select2/providers/ObjectAdapterMementoProviderForReferenceParamOrPropertyAutoComplete.java
+++ 
b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/select2/providers/ObjectAdapterMementoProviderForReferenceParamOrPropertyAutoComplete.java
@@ -39,16 +39,17 @@ package 
org.apache.isis.viewer.wicket.ui.components.widgets.select2.providers;
 import java.util.Collection;
 import java.util.List;
 
-import com.google.common.base.Function;
-import com.google.common.collect.Collections2;
-import com.google.common.collect.Lists;
-
+import org.apache.isis.applib.internal.collections._Lists;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.oid.RootOid;
 import org.apache.isis.viewer.wicket.model.isis.WicketViewerSettings;
 import org.apache.isis.viewer.wicket.model.mementos.ObjectAdapterMemento;
 import org.apache.isis.viewer.wicket.model.models.ScalarModel;
 
+import com.google.common.base.Function;
+import com.google.common.collect.Collections2;
+import com.google.common.collect.Lists;
+
 public class 
ObjectAdapterMementoProviderForReferenceParamOrPropertyAutoComplete
         extends ObjectAdapterMementoProviderAbstract {
 
@@ -67,9 +68,7 @@ public class 
ObjectAdapterMementoProviderForReferenceParamOrPropertyAutoComplete
                     getScalarModel().getAutoComplete(term, 
getAuthenticationSession(), getDeploymentCategory());
             autoCompleteChoices.addAll(autoCompleteAdapters);
         }
-        // take a copy otherwise so is eagerly evaluated and memento objects 
correctly built
-        return Lists.newArrayList(
-                Lists.transform(autoCompleteChoices, 
ObjectAdapterMemento.Functions.fromAdapter()));
+        return _Lists.transform(autoCompleteChoices, 
ObjectAdapterMemento.Functions.fromAdapter());
     }
 
     @Override

-- 
To stop receiving notification emails like this one, please contact
ahu...@apache.org.

Reply via email to