From b491a1d67b513f6a6f549fe6fcb374d731e0beca Mon Sep 17 00:00:00 2001 From: Adrien Hopkins Date: Thu, 17 Oct 2019 16:31:38 -0400 Subject: Changed the ZeroIsNullMap to a more general ConditionalExistenceMap. --- src/org/unitConverter/math/ObjectProduct.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/org/unitConverter/math/ObjectProduct.java') diff --git a/src/org/unitConverter/math/ObjectProduct.java b/src/org/unitConverter/math/ObjectProduct.java index 21ab207..0cf89ec 100644 --- a/src/org/unitConverter/math/ObjectProduct.java +++ b/src/org/unitConverter/math/ObjectProduct.java @@ -92,7 +92,8 @@ public final class ObjectProduct { * @since 2019-10-16 */ private ObjectProduct(final Map exponents) { - this.exponents = Collections.unmodifiableMap(ZeroIsNullMap.create(new HashMap<>(exponents))); + this.exponents = Collections.unmodifiableMap(ConditionalExistenceCollections + .conditionalExistenceMap(new HashMap<>(exponents), e -> !Integer.valueOf(0).equals(e.getValue()))); } /** -- cgit v1.2.3