Skip to content

Commit

Permalink
JEXL-421: added methods to find 'best' common class;
Browse files Browse the repository at this point in the history
- updated ArrayBuilder;
- added test;
- updated changes & release notes;
  • Loading branch information
Henri Biestro committed Feb 15, 2024
1 parent b10477e commit a6c1366
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/test/java/org/apache/commons/jexl3/ArrayTypeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ public void testArrayTypes() {

Set<Class<?>> sset = ClassMisc.getSuperClasses(ArrayList.class, ArrayDeque.class);
Assert.assertFalse(sset.isEmpty());
// in java 21, a SequenceCollection interface is added to the sset
List<Class<?>> expected = Arrays.asList(AbstractCollection.class, Collection.class, Iterable.class, Cloneable.class, Serializable.class);
Assert.assertEquals(expected, new ArrayList(sset));
Assert.assertTrue(sset.containsAll(expected));

Class<?> collection = ClassMisc.getCommonSuperClass(ArrayList.class, Collections.emptyList().getClass());
Assert.assertEquals(AbstractList.class, collection);
collection = ClassMisc.getSuperClasses(ArrayList.class, Collections.emptyList().getClass())
Expand Down

0 comments on commit a6c1366

Please sign in to comment.