ben-manes commented on code in PR #301:
URL: 
https://github.com/apache/commons-collections/pull/301#discussion_r862521177


##########
src/test/java/org/apache/commons/collections4/GuavaTestlibTest.java:
##########
@@ -0,0 +1,76 @@
+/*
+ * 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.commons.collections4;
+
+import java.util.Map;
+import java.util.function.Supplier;
+
+import org.apache.commons.collections4.map.HashedMap;
+import org.apache.commons.collections4.map.LRUMap;
+import org.apache.commons.collections4.map.LinkedMap;
+import org.apache.commons.collections4.map.ReferenceMap;
+
+import com.google.common.collect.testing.MapTestSuiteBuilder;
+import com.google.common.collect.testing.TestStringMapGenerator;
+import com.google.common.collect.testing.features.CollectionFeature;
+import com.google.common.collect.testing.features.CollectionSize;
+import com.google.common.collect.testing.features.MapFeature;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * This test uses Google's Guava Testlib testing libraries to validate the
+ * contract of collection classes in Commons Collections. This was introduced
+ * after COLLECTIONS-802, where the issue reported was found with Testlib,
+ * with thanks to Ben Manes.
+ *
+ * @since 4.5.0
+ * @see <a 
href="https://github.com/google/guava/tree/master/guava-testlib";>https://github.com/google/guava/tree/master/guava-testlib</a>
+ * @see <a 
href="https://issues.apache.org/jira/browse/COLLECTIONS-802";>https://issues.apache.org/jira/browse/COLLECTIONS-802</a>
+ */
+public final class GuavaTestlibTest extends TestCase {
+
+    public static Test suite() {

Review Comment:
   At least in the case of `GrowthList` some of the failures are expected since 
it modified the `List` contract,
   
   ```java
    * Decorates another <code>List</code> to make it seamlessly grow when
    * indices larger than the list size are used on add and set,
    * avoiding most IndexOutOfBoundsExceptions.
   ```
   
   Technically a violation of the contract, but expected.
   ```java
    * @throws IndexOutOfBoundsException if the index is out of range
    *         ({@code index < 0 || index > size()})
    */
   void add(int index, E element);
   ```
   
   You can use `.suppressing(Method...)` to disable those cases. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to