Merge pull request '逆向 List' (#18) from code_bank into main

Reviewed-on: https://src.ossez.com/cwiki-us-docs/java-tutorials/pulls/18
This commit is contained in:
honeymoose 2022-05-01 18:03:08 -04:00
commit fc5c80fcfc
3 changed files with 42 additions and 13 deletions

View File

@ -4,10 +4,9 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="080575e3-7e62-4649-ae70-06fb6130a866" name="Changes" comment="添加文章链接: https://www.ossez.com/t/java-list-null/13940">
<list default="true" id="080575e3-7e62-4649-ae70-06fb6130a866" name="Changes" comment="更新: Java 从一个 List 中删除重复的元素 文章链接">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/core-java-modules/core-java-collections-list/src/test/java/com/ossez/collections/JavaCollectionCleanupUnitTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/core-java-modules/core-java-collections-list/src/test/java/com/ossez/collections/JavaCollectionCleanupUnitTest.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/core-java-modules/core-java-collections-list/src/test/java/com/ossez/java8/Java8CollectionCleanupUnitTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/core-java-modules/core-java-collections-list/src/test/java/com/ossez/java8/Java8CollectionCleanupUnitTest.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/core-java-modules/core-java-collections-list/src/test/java/com/ossez/java/list/ReverseIteratorUnitTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/core-java-modules/core-java-collections-list/src/test/java/com/ossez/java/list/ReverseIteratorUnitTest.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -67,7 +66,7 @@
<recent name="com.ossez.collections" />
</key>
</component>
<component name="RunManager" selected="JUnit.JavaCollectionCleanupUnitTest.givenListContainsDuplicates_whenRemovingDuplicatesWithPlainJava_thenCorrect">
<component name="RunManager" selected="JUnit.ReverseIteratorUnitTest.whenIteratingUsingGuava_thenCorrect">
<configuration default="true" type="DjangoTestsConfigurationType">
<module name="junit-5-basics" />
<option name="INTERPRETER_OPTIONS" value="" />
@ -171,17 +170,17 @@
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="RandomListElementUnitTest.givenList_whenRandomIndexChosen_shouldReturnARandomElementUsingMathRandom" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
<configuration name="ReverseIteratorUnitTest.whenIteratingUsingGuava_thenCorrect" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
<module name="core-java-collections-list" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="com.ossez.list.random.*" />
<option name="PATTERN" value="com.ossez.java.list.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="PACKAGE_NAME" value="com.ossez.list.random" />
<option name="MAIN_CLASS_NAME" value="com.ossez.list.random.RandomListElementUnitTest" />
<option name="METHOD_NAME" value="givenList_whenRandomIndexChosen_shouldReturnARandomElementUsingMathRandom" />
<option name="PACKAGE_NAME" value="com.ossez.java.list" />
<option name="MAIN_CLASS_NAME" value="com.ossez.java.list.ReverseIteratorUnitTest" />
<option name="METHOD_NAME" value="whenIteratingUsingGuava_thenCorrect" />
<option name="TEST_OBJECT" value="method" />
<method v="2">
<option name="Make" enabled="true" />
@ -296,11 +295,11 @@
</configuration>
<recent_temporary>
<list>
<item itemvalue="JUnit.ReverseIteratorUnitTest.whenIteratingUsingGuava_thenCorrect" />
<item itemvalue="JUnit.JavaCollectionCleanupUnitTest.givenListContainsDuplicates_whenRemovingDuplicatesWithPlainJava_thenCorrect" />
<item itemvalue="JUnit.JavaCollectionCleanupUnitTest.givenListContainsNulls_whenRemovingNullsWithGuavaV1_thenCorrect" />
<item itemvalue="JUnit.JavaCollectionCleanupUnitTest.givenListContainsNulls_whenRemovingNullsWithPlainJavaAlternative_thenCorrect" />
<item itemvalue="JUnit.JavaCollectionCleanupUnitTest.givenListContainsNulls_whenRemovingNullsWithPlainJava_thenCorrect" />
<item itemvalue="JUnit.RandomListElementUnitTest.givenList_whenRandomIndexChosen_shouldReturnARandomElementUsingMathRandom" />
</list>
</recent_temporary>
</component>
@ -436,7 +435,21 @@
<option name="project" value="LOCAL" />
<updated>1651415236464</updated>
</task>
<option name="localTasksCounter" value="18" />
<task id="LOCAL-00018" summary="Java 从一个 List 中删除所有重复的元素: https://www.ossez.com/t/java-list/13942">
<created>1651417575415</created>
<option name="number" value="00018" />
<option name="presentableId" value="LOCAL-00018" />
<option name="project" value="LOCAL" />
<updated>1651417575415</updated>
</task>
<task id="LOCAL-00019" summary="更新: Java 从一个 List 中删除重复的元素 文章链接">
<created>1651418643865</created>
<option name="number" value="00019" />
<option name="presentableId" value="LOCAL-00019" />
<option name="project" value="LOCAL" />
<updated>1651418643865</updated>
</task>
<option name="localTasksCounter" value="20" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
@ -471,7 +484,9 @@
<MESSAGE value="提交所有代码,为将默认分支名从 master 切换到 main 做准备" />
<MESSAGE value="init submit all for code branch" />
<MESSAGE value="添加文章链接: https://www.ossez.com/t/java-list-null/13940" />
<option name="LAST_COMMIT_MESSAGE" value="添加文章链接: https://www.ossez.com/t/java-list-null/13940" />
<MESSAGE value="Java 从一个 List 中删除所有重复的元素: https://www.ossez.com/t/java-list/13942" />
<MESSAGE value="更新: Java 从一个 List 中删除重复的元素 文章链接" />
<option name="LAST_COMMIT_MESSAGE" value="更新: Java 从一个 List 中删除重复的元素 文章链接" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
@ -486,6 +501,11 @@
<line>54</line>
<option name="timeStamp" value="4" />
</line-breakpoint>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/core-java-modules/core-java-collections-list/src/test/java/com/ossez/java/list/ReverseIteratorUnitTest.java</url>
<line>88</line>
<option name="timeStamp" value="7" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component>

View File

@ -5,7 +5,7 @@
### 相关文章:
- [Java 如何从一个 List 中随机获得元素](https://www.ossez.com/t/java-list/13934)
- [Java 从一个 List 中删除 null 元素](https://www.ossez.com/t/java-list-null/13940)
- [Removing all duplicates from a List in Java](http://www.baeldung.com/java-remove-duplicates-from-list)
- [Java 从一个 List 中删除重复的元素](https://www.ossez.com/t/java-list/13942)
- [How to TDD a List Implementation in Java](http://www.baeldung.com/java-test-driven-list)
- [Iterating Backward Through a List](http://www.baeldung.com/java-list-iterate-backwards)
- [如何从 Java 的 List 中删除第一个元素](https://www.ossez.com/t/java-list/13919)

View File

@ -12,7 +12,16 @@ import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.google.common.collect.Lists;
import org.junit.jupiter.api.TestInstance;
/**
* Test for list Reverse
*
* <p><a href="https://www.ossez.com/t/java-list/13943">https://www.ossez.com/t/java-list/13943</a></p>
*
* @author YuCheng
*/
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public class ReverseIteratorUnitTest {
private final ReverseIterator reverseIterator = new ReverseIterator();