diff --git a/src/main/java/org/cactoos/collection/TailOf.java b/src/main/java/org/cactoos/collection/TailOf.java deleted file mode 100644 index f5e5455c01..0000000000 --- a/src/main/java/org/cactoos/collection/TailOf.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2017-2020 Yegor Bugayenko - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -package org.cactoos.collection; - -import org.cactoos.iterable.IterableOf; - -/** - * Tail portion of the collection. - * - *

There is no thread-safety guarantee. - * - * @param Element type - * @since 0.31 - * @todo #1242:30min Remove this class and replace it everywhere - * it was needed by the appropriate usage of TailOf from list, - * set, iterable, iterator or any other relevant concrete - * collection implementation. See #1242 for the rationale about this. - */ -public final class TailOf extends CollectionEnvelope { - - /** - * Ctor. - * @param num Number of tail elements - * @param src Source elements - */ - @SafeVarargs - public TailOf(final int num, final T... src) { - this(num, new IterableOf<>(src)); - } - - /** - * Ctor. - * @param num Number of tail elements - * @param src Source iterable - */ - public TailOf(final int num, final Iterable src) { - super( - new Sticky<>( - new org.cactoos.iterable.TailOf<>(num, src) - ) - ); - } -} diff --git a/src/test/java/org/cactoos/collection/TailOfTest.java b/src/test/java/org/cactoos/collection/TailOfTest.java deleted file mode 100644 index 25f3c0af1d..0000000000 --- a/src/test/java/org/cactoos/collection/TailOfTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2017-2020 Yegor Bugayenko - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -package org.cactoos.collection; - -import org.cactoos.iterable.IterableOf; -import org.hamcrest.core.AllOf; -import org.hamcrest.core.IsCollectionContaining; -import org.hamcrest.core.IsEqual; -import org.junit.Test; -import org.llorllale.cactoos.matchers.Assertion; - -/** - * Test case for {@link TailOf}. - * - * @since 0.31 - * @checkstyle JavadocMethodCheck (500 lines) - */ -public final class TailOfTest { - - @Test - @SuppressWarnings("PMD.AvoidDuplicateLiterals") - public void tailCollection() { - new Assertion<>( - "Can't get tail portion of collection", - new TailOf<>( - 2, - "one", "two", "three", "four" - ), - new AllOf<>( - new IterableOf>>( - new IsCollectionContaining<>(new IsEqual<>("three")), - new IsCollectionContaining<>(new IsEqual<>("four")) - ) - ) - ).affirm(); - } -}