You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2022/04/06 09:36:10 UTC
[isis] branch master updated: ISIS-2297: purge unused classes from non-internal commons
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 00506d65f1 ISIS-2297: purge unused classes from non-internal commons
00506d65f1 is described below
commit 00506d65f120a30540c501b3c94ef87debc64b0a
Author: Andi Huber <ah...@apache.org>
AuthorDate: Wed Apr 6 11:36:03 2022 +0200
ISIS-2297: purge unused classes from non-internal commons
---
.../org/apache/isis/commons/btree/Compound.java | 147 ---------
.../org/apache/isis/commons/btree/FunCompound.java | 203 ------------
.../isis/commons/exceptions/ExceptionUtils.java | 350 ---------------------
.../isis/commons/exceptions/package-info.java | 25 --
.../apache/isis/commons/btree/CompoundTest.java | 171 ----------
5 files changed, 896 deletions(-)
diff --git a/commons/src/main/java/org/apache/isis/commons/btree/Compound.java b/commons/src/main/java/org/apache/isis/commons/btree/Compound.java
deleted file mode 100644
index d445e1c7a2..0000000000
--- a/commons/src/main/java/org/apache/isis/commons/btree/Compound.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * 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.commons.btree;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import org.apache.isis.commons.internal.base._Casts;
-import org.apache.isis.commons.internal.base._Either;
-
-import lombok.AccessLevel;
-import lombok.EqualsAndHashCode;
-import lombok.NonNull;
-import lombok.RequiredArgsConstructor;
-import lombok.ToString;
-
-/**
- * Represents a binary tree data structure.
- *
- * @since 2.0 {@index}
- */
-@RequiredArgsConstructor(access=AccessLevel.PROTECTED)
-@ToString @EqualsAndHashCode
-public class Compound<T> {
-
- private final _Either<T, Compound<T>> left;
- private final _Either<T, Compound<T>> right;
- private final int elementCount;
-
- // -- FACTORIES
-
- public static <T> Compound<T> of(final @NonNull T left) {
- return new Compound<>(_Either.left(left), _Either.right(nil()), 1);
- }
-
- public static <T> Compound<T> of(final @NonNull T left, final @NonNull T right) {
- return new Compound<>(_Either.left(left), _Either.left(right), 2);
- }
-
- public static <T> Compound<T> of(
- final @NonNull T left,
- final @NonNull Compound<T> right) {
- return new Compound<>(
- _Either.left(left),
- _Either.right(right),
- 1 + right.elementCount);
- }
-
- public static <T> Compound<T> of(
- final @NonNull Compound<T> left,
- final @NonNull T right) {
- return new Compound<>(
- _Either.right(left),
- _Either.left(right),
- left.elementCount + 1);
- }
-
- public static <T> Compound<T> of(
- final @NonNull Compound<T> left,
- final @NonNull Compound<T> right) {
- return new Compound<>(
- _Either.right(left),
- _Either.right(right),
- left.elementCount + right.elementCount);
- }
-
- // -- SIZE / ELEMENT COUNT
-
- /**
- * @return Number of contained elements of type <T>.
- */
- public int size() {
- return elementCount;
- }
-
- // -- TRAVERSAL
-
- public Stream<T> streamDepthFirstPostorder() {
- return elementCount!=0 // intercept NIL
- ? Stream.concat(
- left.fold(Stream::of, Compound::streamDepthFirstPostorder),
- right.fold(Stream::of, Compound::streamDepthFirstPostorder))
- : Stream.empty();
- }
-
- // -- EXTRACTION
-
- public List<T> flatten() {
- return streamDepthFirstPostorder()
- .collect(Collectors.toCollection(()->new ArrayList<>(elementCount)));
- }
-
- // -- MAPPING
-
- public <X> Compound<X> map(final Function<T, X> mapper) {
- return new MappedStruct<>(this, mapper);
- }
-
- final static class MappedStruct<A, B> extends Compound<B> {
-
- final Compound<A> origin;
- final Function<A, B> mapper;
-
- protected MappedStruct(
- final Compound<A> origin,
- final Function<A, B> mapper) {
- super(null, null, origin.elementCount);
- this.origin = origin;
- this.mapper = mapper;
- }
-
- @Override
- public Stream<B> streamDepthFirstPostorder() {
- return origin.streamDepthFirstPostorder()
- .map(mapper);
- }
-
- }
-
- // -- NIL / THE EMPTY STRUCT
-
- private final static Compound<?> NIL = new Compound<>(null, null, 0);
- public static <T> Compound<T> nil() {
- return _Casts.uncheckedCast(NIL);
- }
-
-
-}
diff --git a/commons/src/main/java/org/apache/isis/commons/btree/FunCompound.java b/commons/src/main/java/org/apache/isis/commons/btree/FunCompound.java
deleted file mode 100644
index 2495c225db..0000000000
--- a/commons/src/main/java/org/apache/isis/commons/btree/FunCompound.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * 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.commons.btree;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import org.apache.isis.commons.internal.base._Casts;
-import org.apache.isis.commons.internal.base._Either;
-
-import lombok.AccessLevel;
-import lombok.EqualsAndHashCode;
-import lombok.NonNull;
-import lombok.RequiredArgsConstructor;
-import lombok.ToString;
-
-/**
- * Represents a binary tree data structure of function elements.
- *
- * @since 2.0 {@index}
- */
-@RequiredArgsConstructor(access=AccessLevel.PROTECTED)
-@ToString @EqualsAndHashCode
-public class FunCompound<T, R> {
-
- private final _Either<Function<T, R>, FunCompound<T, R>> left;
- private final _Either<Function<T, R>, FunCompound<T, R>> right;
- private final int elementCount;
-
- // -- FACTORIES
-
- public static <T, R> FunCompound<T, R> of(final @NonNull Function<T, R> left) {
- return new FunCompound<>(_Either.left(left), _Either.right(nil()), 1);
- }
-
- public static <T, R> FunCompound<T, R> of(final @NonNull Function<T, R> left, final @NonNull Function<T, R> right) {
- return new FunCompound<>(_Either.left(left), _Either.left(right), 2);
- }
-
- public static <T, R> FunCompound<T, R> of(
- final @NonNull Function<T, R> left,
- final @NonNull FunCompound<T, R> right) {
- return new FunCompound<>(
- _Either.left(left),
- _Either.right(right),
- 1 + right.elementCount);
- }
-
- public static <T, R> FunCompound<T, R> of(
- final @NonNull FunCompound<T, R> left,
- final @NonNull Function<T, R> right) {
- return new FunCompound<>(
- _Either.right(left),
- _Either.left(right),
- left.elementCount + 1);
- }
-
- public static <T, R> FunCompound<T, R> of(
- final @NonNull FunCompound<T, R> left,
- final @NonNull FunCompound<T, R> right) {
- return new FunCompound<>(
- _Either.right(left),
- _Either.right(right),
- left.elementCount + right.elementCount);
- }
-
- // -- SIZE / ELEMENT COUNT
-
- /**
- * @return Number of contained elements of type <T>.
- */
- public int size() {
- return elementCount;
- }
-
- // -- TRAVERSAL
-
- public Stream<Function<T, R>> streamDepthFirstPostorder() {
- return elementCount!=0 // intercept NIL
- ? Stream.concat(
- left.fold(Stream::of, FunCompound::streamDepthFirstPostorder),
- right.fold(Stream::of, FunCompound::streamDepthFirstPostorder))
- : Stream.empty();
- }
-
- // -- EXTRACTION
-
- public List<Function<T, R>> flatten() {
- return streamDepthFirstPostorder()
- .collect(Collectors.toCollection(()->new ArrayList<>(elementCount)));
- }
-
- // -- APPLY VALUE
-
- public Compound<R> apply(final T value) {
- return new AppliedStruct<>(this, value);
- }
-
- final static class AppliedStruct<A, B> extends Compound<B> {
-
- final FunCompound<A, B> origin;
- final A value;
-
- protected AppliedStruct(
- final FunCompound<A, B> origin,
- final A value) {
- super(null, null, origin.elementCount);
- this.origin = origin;
- this.value = value;
- }
-
- @Override
- public Stream<B> streamDepthFirstPostorder() {
- return origin.streamDepthFirstPostorder()
- .map(fun->fun.apply(value));
- }
-
- }
-
- // -- MAPPING
-
- public <X> FunCompound<T, X> map(final Function<R, X> mapper) {
- return new MappedFunStruct<>(this, mapper);
- }
-
- final static class MappedFunStruct<A, B, C> extends FunCompound<A, C> {
-
- final FunCompound<A, B> origin;
- final Function<B, C> mapper;
-
- protected MappedFunStruct(
- final FunCompound<A, B> origin,
- final Function<B, C> mapper) {
- super(null, null, origin.elementCount);
- this.origin = origin;
- this.mapper = mapper;
- }
-
- @Override
- public Stream<Function<A, C>> streamDepthFirstPostorder() {
- return origin.streamDepthFirstPostorder()
- .map(fun->fun.andThen(mapper));
- }
-
- }
-
- // -- COMPOSITION
-
- public <X> FunCompound<T, X> compose(final FunCompound<R, X> other) {
- return new ComposedFunStruct<>(this, other);
- }
-
- final static class ComposedFunStruct<A, B, C> extends FunCompound<A, C> {
-
- final FunCompound<A, B> origin;
- final FunCompound<B, C> other;
-
- protected ComposedFunStruct(
- final FunCompound<A, B> origin,
- final FunCompound<B, C> other) {
- super(null, null, origin.elementCount);
- this.origin = origin;
- this.other = other;
- }
-
- @Override
- public Stream<Function<A, C>> streamDepthFirstPostorder() {
- return origin.streamDepthFirstPostorder()
- .flatMap(fun->
- other.streamDepthFirstPostorder()
- .map(otherFun->fun.andThen(otherFun))
- );
- }
-
- }
-
- // -- NIL / THE EMPTY STRUCT
-
- private final static FunCompound<?, ?> NIL = new FunCompound<>(null, null, 0);
- public static <T, R> FunCompound<T, R> nil() {
- return _Casts.uncheckedCast(NIL);
- }
-
-}
diff --git a/commons/src/main/java/org/apache/isis/commons/exceptions/ExceptionUtils.java b/commons/src/main/java/org/apache/isis/commons/exceptions/ExceptionUtils.java
deleted file mode 100644
index 23b0e935fb..0000000000
--- a/commons/src/main/java/org/apache/isis/commons/exceptions/ExceptionUtils.java
+++ /dev/null
@@ -1,350 +0,0 @@
-/*
- * 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.commons.exceptions;
-
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.isis.commons.internal._Constants;
-
-/**
- * <p>Provides utilities for manipulating and examining
- * <code>Throwable</code> objects.</p>
- *
- * @author Daniel L. Rall
- * @author Dmitri Plotnikov
- * @author Stephen Colebourne
- * @author <a href="mailto:ggregory@seagullsw.com">Gary Gregory</a>
- * @author Pete Gieser
- * @since 1.0
- * @version $Id: ExceptionUtils.java 594278 2007-11-12 19:58:30Z bayard $
- */
-// portions copied in from commons-lang 2.6
-public class ExceptionUtils {
-
- /**
- * <p>The names of methods commonly used to access a wrapped exception.</p>
- */
- private static String[] CAUSE_METHOD_NAMES = {
- "getCause",
- "getNextException",
- "getTargetException",
- "getException",
- "getSourceException",
- "getRootCause",
- "getCausedByException",
- "getNested",
- "getLinkedException",
- "getNestedException",
- "getLinkedCause",
- "getThrowable",
- };
-
- /**
- * <p>The Method object for Java 1.4 getCause.</p>
- */
- private static final Method THROWABLE_CAUSE_METHOD;
-
- static {
- Method causeMethod;
- try {
- causeMethod = Throwable.class.getMethod("getCause", _Constants.emptyClasses);
- } catch (Exception e) {
- causeMethod = null;
- }
- THROWABLE_CAUSE_METHOD = causeMethod;
- }
-
- /**
- * <p>
- * Public constructor allows an instance of <code>ExceptionUtils</code> to be created, although that is not
- * normally necessary.
- * </p>
- */
- public ExceptionUtils() {
- super();
- }
-
- //-----------------------------------------------------------------------
- /**
- * <p>Introspects the <code>Throwable</code> to obtain the cause.</p>
- *
- * <p>The method searches for methods with specific names that return a
- * <code>Throwable</code> object. This will pick up most wrapping exceptions.
- *
- * <p>The default list searched for are:</p>
- * <ul>
- * <li><code>getCause()</code></li>
- * <li><code>getNextException()</code></li>
- * <li><code>getTargetException()</code></li>
- * <li><code>getException()</code></li>
- * <li><code>getSourceException()</code></li>
- * <li><code>getRootCause()</code></li>
- * <li><code>getCausedByException()</code></li>
- * <li><code>getNested()</code></li>
- * </ul>
- *
- * <p>In the absence of any such method, the object is inspected for a
- * <code>detail</code> field assignable to a <code>Throwable</code>.</p>
- *
- * <p>If none of the above is found, returns <code>null</code>.</p>
- *
- * @param throwable the throwable to introspect for a cause, may be null
- * @return the cause of the <code>Throwable</code>,
- * <code>null</code> if none found or null throwable input
- * @since 1.0
- */
- public static Throwable getCause(Throwable throwable) {
- if (throwable == null) {
- return null;
- }
- Throwable cause = getCauseUsingWellKnownTypes(throwable);
- if (cause == null) {
- for (String methodName : CAUSE_METHOD_NAMES) {
- if (methodName != null) {
- cause = getCauseUsingMethodName(throwable, methodName);
- if (cause != null) {
- break;
- }
- }
- }
- if (cause == null) {
- cause = getCauseUsingFieldName(throwable, "detail");
- }
- }
- return cause;
- }
-
- /**
- * <p>Finds a <code>Throwable</code> for known types.</p>
- *
- * <p>Uses <code>instanceof</code> checks to examine the exception,
- * looking for well known types which could contain chained or
- * wrapped exceptions.</p>
- *
- * @param throwable the exception to examine
- * @return the wrapped exception, or <code>null</code> if not found
- */
- private static Throwable getCauseUsingWellKnownTypes(Throwable throwable) {
- /*if (throwable instanceof Nestable) {
- return ((Nestable) throwable).getCause();
- } else */
- if (throwable instanceof SQLException) {
- return ((SQLException) throwable).getNextException();
- }
- if (throwable instanceof InvocationTargetException) {
- return ((InvocationTargetException) throwable).getTargetException();
- }
- return null;
- }
-
- /**
- * <p>Finds a <code>Throwable</code> by method name.</p>
- *
- * @param throwable the exception to examine
- * @param methodName the name of the method to find and invoke
- * @return the wrapped exception, or <code>null</code> if not found
- */
- private static Throwable getCauseUsingMethodName(Throwable throwable, String methodName) {
- Method method;
- try {
- method = throwable.getClass().getMethod(methodName);
- } catch (NoSuchMethodException | SecurityException ignored) {
- return null;
- }
-
- if (!Throwable.class.isAssignableFrom(method.getReturnType())) {
- return null;
- }
- try {
- return (Throwable) method.invoke(throwable);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException ignored) {
- return null;
- }
- }
-
- /**
- * <p>Finds a <code>Throwable</code> by field name.</p>
- *
- * @param throwable the exception to examine
- * @param fieldName the name of the attribute to examine
- * @return the wrapped exception, or <code>null</code> if not found
- */
- private static Throwable getCauseUsingFieldName(Throwable throwable, String fieldName) {
- Field field = null;
- try {
- field = throwable.getClass().getField(fieldName);
- } catch (NoSuchFieldException | SecurityException ignored) {
- // exception ignored
- }
-
- if (field != null && Throwable.class.isAssignableFrom(field.getType())) {
- try {
- return (Throwable) field.get(throwable);
- } catch (IllegalAccessException | IllegalArgumentException ignored) {
- // exception ignored
- }
- }
- return null;
- }
-
- /**
- * <p>Checks if the Throwable class has a <code>getCause</code> method.</p>
- *
- * <p>This is true for JDK 1.4 and above.</p>
- *
- * @return true if Throwable is nestable
- * @since 2.0
- */
- public static boolean isThrowableNested() {
- return THROWABLE_CAUSE_METHOD != null;
- }
-
- /**
- * <p>Checks whether this <code>Throwable</code> class can store a cause.</p>
- *
- * <p>This method does <b>not</b> check whether it actually does store a cause.<p>
- *
- * @param throwable the <code>Throwable</code> to examine, may be null
- * @return boolean <code>true</code> if nested otherwise <code>false</code>
- * @since 2.0
- */
- public static boolean isNestedThrowable(Throwable throwable) {
- if (throwable == null) {
- return false;
- }
-
- /*if (throwable instanceof Nestable) {
- return true;
- } else*/ if (throwable instanceof SQLException) {
- return true;
- } else if (throwable instanceof InvocationTargetException) {
- return true;
- } else if (isThrowableNested()) {
- return true;
- }
-
- Class<?> cls = throwable.getClass();
- for (final String causeMethodName : CAUSE_METHOD_NAMES) {
- try {
- Method method = cls.getMethod(causeMethodName, _Constants.emptyClasses);
- if (method != null && Throwable.class.isAssignableFrom(method.getReturnType())) {
- return true;
- }
- } catch (NoSuchMethodException | SecurityException ignored) {
- // exception ignored
- }
- }
-
- try {
- Field field = cls.getField("detail");
- if (field != null) {
- return true;
- }
- } catch (NoSuchFieldException | SecurityException ignored) {
- // exception ignored
- }
-
- return false;
- }
-
- /**
- * <p>Returns the list of <code>Throwable</code> objects in the
- * exception chain.</p>
- *
- * <p>A throwable without cause will return an array containing
- * one element - the input throwable.
- * A throwable with one cause will return an array containing
- * two elements. - the input throwable and the cause throwable.
- * A <code>null</code> throwable will return an array of size zero.</p>
- *
- * <p>From version 2.2, this method handles recursive cause structures
- * that might otherwise cause infinite loops. The cause chain is
- * processed until the end is reached, or until the next item in the
- * chain is already in the result set.</p>
- *
- * @see #getThrowableList(Throwable)
- * @param throwable the throwable to inspect, may be null
- * @return the array of throwables, never null
- */
- public static Throwable[] getThrowables(Throwable throwable) {
- List<Throwable> list = getThrowableList(throwable);
- return (Throwable[]) list.toArray(new Throwable[list.size()]);
- }
-
- /**
- * <p>Returns the list of <code>Throwable</code> objects in the
- * exception chain.</p>
- *
- * <p>A throwable without cause will return a list containing
- * one element - the input throwable.
- * A throwable with one cause will return a list containing
- * two elements. - the input throwable and the cause throwable.
- * A <code>null</code> throwable will return a list of size zero.</p>
- *
- * <p>This method handles recursive cause structures that might
- * otherwise cause infinite loops. The cause chain is processed until
- * the end is reached, or until the next item in the chain is already
- * in the result set.</p>
- *
- * @param throwable the throwable to inspect, may be null
- * @return the list of throwables, never null
- * @since Commons Lang 2.2
- */
- public static List<Throwable> getThrowableList(Throwable throwable) {
- List<Throwable> list = new ArrayList<Throwable>();
- while (throwable != null && list.contains(throwable) == false) {
- list.add(throwable);
- throwable = ExceptionUtils.getCause(throwable);
- }
- return list;
- }
-
- //-----------------------------------------------------------------------
- /**
- * <p>A way to get the entire nested stack-trace of an throwable.</p>
- *
- * <p>The result of this method is highly dependent on the JDK version
- * and whether the exceptions override printStackTrace or not.</p>
- *
- * @param throwable the <code>Throwable</code> to be examined
- * @return the nested stack trace, with the root cause first
- * @since 2.0
- */
- public static String getFullStackTrace(Throwable throwable) {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw, true);
- Throwable[] ts = getThrowables(throwable);
- for (int i = 0; i < ts.length; i++) {
- ts[i].printStackTrace(pw);
- if (isNestedThrowable(ts[i])) {
- break;
- }
- }
- return sw.getBuffer().toString();
- }
-
-}
diff --git a/commons/src/main/java/org/apache/isis/commons/exceptions/package-info.java b/commons/src/main/java/org/apache/isis/commons/exceptions/package-info.java
deleted file mode 100644
index de038f6e03..0000000000
--- a/commons/src/main/java/org/apache/isis/commons/exceptions/package-info.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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.
- */
-
-/**
- * Defines {@link org.apache.isis.commons.exceptions.IsisException base class}
- * for exceptions raised either by Isis itself or by the domain model
- * running on top of Isis.
- */
-package org.apache.isis.commons.exceptions;
\ No newline at end of file
diff --git a/commons/src/test/java/org/apache/isis/commons/btree/CompoundTest.java b/commons/src/test/java/org/apache/isis/commons/btree/CompoundTest.java
deleted file mode 100644
index 179bfde65c..0000000000
--- a/commons/src/test/java/org/apache/isis/commons/btree/CompoundTest.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * 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.commons.btree;
-
-import java.time.Duration;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.time.LocalTime;
-import java.time.temporal.ChronoUnit;
-import java.util.List;
-
-import org.junit.jupiter.api.Test;
-import org.springframework.core.convert.converter.Converter;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-
-import org.apache.isis.commons.internal.base._Strings;
-
-import lombok.val;
-
-class CompoundTest {
-
- @Test
- void pseudoCompound() {
- val comp = Compound.of("a");
-
- assertEquals(List.of("a"), comp.flatten());
- assertEquals(1, comp.size());
- }
-
- @Test
- void constructingElements() {
- val comp = Compound.of("a", "b");
-
- assertEquals(List.of("a", "b"), comp.flatten());
- assertEquals(2, comp.size());
- }
-
- @Test
- void constructingCompounds() {
-
- val comp = Compound.<String>of(
- Compound.of("a", "b"),
- Compound.of("c", "d"));
-
- assertEquals(List.of("a", "b", "c", "d"), comp.flatten());
- assertEquals(4, comp.size());
- }
-
- @Test
- void constructingElementAndCompound() {
-
- val comp = Compound.<String>of(
- "a",
- Compound.of("c", "d"));
-
- assertEquals(List.of("a", "c", "d"), comp.flatten());
- assertEquals(3, comp.size());
- }
-
- @Test
- void constructingCompoundAndElement() {
-
- val comp = Compound.<String>of(
- Compound.of("a", "b"),
- "d");
-
- assertEquals(List.of("a", "b", "d"), comp.flatten());
- assertEquals(3, comp.size());
- }
-
- @Test
- void constructionNesting() {
-
- val comp = Compound.of(
- Compound.<String>of(
- Compound.of("a", "b"),
- Compound.of("c", "d")),
- Compound.<String>of(
- Compound.of("e", "f"),
- Compound.of("g", "h")));
-
- assertEquals(List.of("a", "b", "c", "d", "e", "f", "g", "h"), comp.flatten());
- assertEquals(8, comp.size());
- }
-
- // -- CONVERTER COMPOSITION
-
- @lombok.Value
- static class CalEntry {
- String name;
- LocalDateTime at;
- Duration duration;
-
- static CalEntry sample() {
- return new CalEntry(
- "entry",
- LocalDateTime.of(LocalDate.of(2021, 9, 27), LocalTime.of(6, 45)),
- Duration.of(30, ChronoUnit.MINUTES));
- }
- }
-
- final Converter<String, String> strIdentity = str->str;
- final Converter<Duration, Long> durCon1 = dur->dur.toMinutes();
- final Converter<Duration, Enum<?>> durCon2 = dur->ChronoUnit.MINUTES;
- final Converter<Long, String> longCon = lon->lon.toString();
- final Converter<Enum<?>, String> enumCon = enu->_Strings.capitalize(enu.name().toLowerCase());
- final Converter<LocalDateTime, LocalDate> ldtCon1 = ldt->ldt.toLocalDate();
- final Converter<LocalDateTime, LocalTime> ldtCon2 = ldt->ldt.toLocalTime();
- final Converter<LocalDate, String> ldCon = ld->ld.toString();
- final Converter<LocalTime, String> ltCon = lt->lt.toString();
- final Converter<CalEntry, String> ceCon1 = ce->ce.getName();
- final Converter<CalEntry, LocalDateTime> ceCon2 = ce->ce.getAt();
- final Converter<CalEntry, Duration> ceCon3 = ce->ce.getDuration();
-
- final Compound<Converter<LocalDateTime, String>> localDateTimeCC = Compound.of(
- ldtCon1.andThen(ldCon),
- ldtCon2.andThen(ltCon));
-
- final Compound<Converter<Duration, String>> durationCC = Compound.of(
- durCon1.andThen(longCon),
- durCon2.andThen(enumCon));
-
- final FunCompound<LocalDateTime, String> localDateTimeFC = FunCompound.of(
- FunCompound.of(ldtCon1::convert).map(ldCon::convert),
- FunCompound.of(ldtCon2::convert).map(ltCon::convert));
-
- final FunCompound<Duration, String> durationFC = FunCompound.of(
- FunCompound.of(durCon1::convert).map(longCon::convert),
- FunCompound.of(durCon2::convert).map(enumCon::convert));
-
-
- final FunCompound<CalEntry, String> calEntryFC = FunCompound.of(
- ceCon1::convert,
- FunCompound.<CalEntry, String>of(
- FunCompound.of(ceCon2::convert).compose(localDateTimeFC),
- FunCompound.of(ceCon3::convert).compose(durationFC)
- ));
-
- @Test
- void converterComposition() {
-
- assertEquals(List.of("30", "Minutes"),
- durationCC
- .map(conv->conv.convert(CalEntry.sample().getDuration()))
- .flatten());
-
- assertEquals(List.of("entry", "2021-09-27", "06:45", "30", "Minutes"),
- calEntryFC
- .apply(CalEntry.sample())
- .flatten());
-
- }
-
-}