@Test public void testEqualsSubClass() { class Sub extends KTypeStack<KType> { }; KTypeStack<KType> l1 = KTypeStack.from(k1, k2, k3); KTypeStack<KType> l2 = new Sub(); KTypeStack<KType> l3 = new Sub(); l2.addAll(l1); l3.addAll(l1); Assertions.assertThat(l2).isEqualTo(l3); Assertions.assertThat(l1).isNotEqualTo(l2); KTypeArrayList<KType> l4 = new KTypeArrayList<>(); l4.addAll(l1); Assertions.assertThat(l1).isNotEqualTo(l4); Assertions.assertThat(l1.equalElements(l4)).isTrue(); }
@SafeVarargs public static <KType> KTypeStack<KType> from(KType... elements) { final KTypeStack<KType> stack = new KTypeStack<KType>(elements.length); stack.push(elements); return stack; }
KTypeStack extends KTypeArrayList<KType> { @SafeVarargs public static <KType> KTypeStack<KType> from(KType... elements) { final KTypeStack<KType> stack = new KTypeStack<KType>(elements.length); stack.push(elements); return stack; } }
KTypeStack extends KTypeArrayList<KType> { @SafeVarargs public static <KType> KTypeStack<KType> from(KType... elements) { final KTypeStack<KType> stack = new KTypeStack<KType>(elements.length); stack.push(elements); return stack; } KTypeStack();  KTypeStack(int expectedElements);  KTypeStack(int expectedElements, ArraySizingStrategy resizer);  KTypeStack(KTypeContainer<KType> container); }
KTypeStack extends KTypeArrayList<KType> { @SafeVarargs public static <KType> KTypeStack<KType> from(KType... elements) { final KTypeStack<KType> stack = new KTypeStack<KType>(elements.length); stack.push(elements); return stack; } KTypeStack();  KTypeStack(int expectedElements);  KTypeStack(int expectedElements, ArraySizingStrategy resizer);  KTypeStack(KTypeContainer<KType> container); void push(KType e1); void push(KType e1, KType e2); void push(KType e1, KType e2, KType e3); void push(KType e1, KType e2, KType e3, KType e4); void push(KType[] elements, int start, int len); @SafeVarargs /* #end */ final void push(KType... elements); int pushAll(KTypeContainer<? extends KType> container); int pushAll(Iterable<? extends KTypeCursor<? extends KType>> iterable); void discard(int count); void discard(); KType pop(); KType peek(); @SafeVarargs /* #end */ static KTypeStack<KType> from(KType... elements); @Override KTypeStack<KType> clone(); }
KTypeStack extends KTypeArrayList<KType> { @SafeVarargs public static <KType> KTypeStack<KType> from(KType... elements) { final KTypeStack<KType> stack = new KTypeStack<KType>(elements.length); stack.push(elements); return stack; } KTypeStack();  KTypeStack(int expectedElements);  KTypeStack(int expectedElements, ArraySizingStrategy resizer);  KTypeStack(KTypeContainer<KType> container); void push(KType e1); void push(KType e1, KType e2); void push(KType e1, KType e2, KType e3); void push(KType e1, KType e2, KType e3, KType e4); void push(KType[] elements, int start, int len); @SafeVarargs /* #end */ final void push(KType... elements); int pushAll(KTypeContainer<? extends KType> container); int pushAll(Iterable<? extends KTypeCursor<? extends KType>> iterable); void discard(int count); void discard(); KType pop(); KType peek(); @SafeVarargs /* #end */ static KTypeStack<KType> from(KType... elements); @Override KTypeStack<KType> clone();  }