Is there a testsuite for Java custom collections implementation?

后端 未结 2 615
余生分开走
余生分开走 2020-12-03 08:06

Out of curiosity, I wrote an own simple implementation of Set for a special case (where the set of all possible entries is fixed, but it\'s no enum

2条回答
  •  情话喂你
    2020-12-03 08:29

    Use the Guava SetTestSuiteBuilder.

    https://github.com/google/guava/blob/master/guava-testlib/src/com/google/common/collect/testing/SetTestSuiteBuilder.java

    Examples:

    https://github.com/google/guava/blob/master/guava-testlib/src/com/google/common/collect/testing/TestsForSetsInJavaUtil.java

    It is released as part of "guava-testlib" in maven central.

提交回复
热议问题