From 6e38095099f139bd620c9640712a2d0d970e417b Mon Sep 17 00:00:00 2001 From: Jan Ouwens Date: Wed, 3 Feb 2021 09:40:23 +0100 Subject: [PATCH] #385 Adds prefab values for (Double|Int|Long)SummaryStatistics --- CHANGELOG.md | 1 + .../internal/prefabvalues/JavaApiPrefabValues.java | 10 ++++++++++ .../extended_contract/JavaApiClassesTest.java | 11 ++++++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c8c3b35d..f1d1f93d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +- Added prefab values for `java.util.DoubleSummaryStatistics`, `java.util.IntSummaryStatistics` and `java.util.LongSummaryStatistics` ([Issue 385](https://github.com/jqno/equalsverifier/issues/385)) ## [3.5.2] - 2021-01-19 ## Fixed diff --git a/src/main/java/nl/jqno/equalsverifier/internal/prefabvalues/JavaApiPrefabValues.java b/src/main/java/nl/jqno/equalsverifier/internal/prefabvalues/JavaApiPrefabValues.java index 043ab2fbc..795f88519 100644 --- a/src/main/java/nl/jqno/equalsverifier/internal/prefabvalues/JavaApiPrefabValues.java +++ b/src/main/java/nl/jqno/equalsverifier/internal/prefabvalues/JavaApiPrefabValues.java @@ -209,6 +209,16 @@ private void addCommonClasses() { Currency.getInstance("EUR"), Currency.getInstance("JPY") ); + + DoubleSummaryStatistics redDoubleStats = new DoubleSummaryStatistics(); + DoubleSummaryStatistics blueDoubleStats = new DoubleSummaryStatistics(); + addValues(DoubleSummaryStatistics.class, redDoubleStats, blueDoubleStats, redDoubleStats); + IntSummaryStatistics redIntStats = new IntSummaryStatistics(); + IntSummaryStatistics blueIntStats = new IntSummaryStatistics(); + addValues(IntSummaryStatistics.class, redIntStats, blueIntStats, redIntStats); + LongSummaryStatistics redLongStats = new LongSummaryStatistics(); + LongSummaryStatistics blueLongStats = new LongSummaryStatistics(); + addValues(LongSummaryStatistics.class, redLongStats, blueLongStats, redLongStats); } private void addDateTimeClasses() { diff --git a/src/test/java/nl/jqno/equalsverifier/integration/extended_contract/JavaApiClassesTest.java b/src/test/java/nl/jqno/equalsverifier/integration/extended_contract/JavaApiClassesTest.java index f943ef8b5..40c2da1b5 100644 --- a/src/test/java/nl/jqno/equalsverifier/integration/extended_contract/JavaApiClassesTest.java +++ b/src/test/java/nl/jqno/equalsverifier/integration/extended_contract/JavaApiClassesTest.java @@ -531,6 +531,9 @@ static final class Java8ApiClassesContainer { private final Period period; private final Year year; private final YearMonth yearMonth; + private final DoubleSummaryStatistics doubleSummaryStatistics; + private final IntSummaryStatistics intSummaryStatistics; + private final LongSummaryStatistics longSummaryStatistics; public Java8ApiClassesContainer( Optional optional, @@ -555,7 +558,10 @@ public Java8ApiClassesContainer( OffsetTime offsetTime, Period period, Year year, - YearMonth yearMonth + YearMonth yearMonth, + DoubleSummaryStatistics doubleSummaryStatistics, + IntSummaryStatistics intSummaryStatistics, + LongSummaryStatistics longSummaryStatistics ) { this.optional = optional; this.optionalDouble = optionalDouble; @@ -580,6 +586,9 @@ public Java8ApiClassesContainer( this.period = period; this.year = year; this.yearMonth = yearMonth; + this.doubleSummaryStatistics = doubleSummaryStatistics; + this.intSummaryStatistics = intSummaryStatistics; + this.longSummaryStatistics = longSummaryStatistics; } @Override