@@ -50,7 +50,7 @@ public void fromValue() {
50
50
@ Test
51
51
public void fromValueAsIntShouldAdaptValue () {
52
52
Integer result = this .map .from ("123" ).asInt (Long ::valueOf )
53
- .toInstance (Integer ::new );
53
+ .toInstance (Integer ::valueOf );
54
54
assertThat (result ).isEqualTo (123 );
55
55
}
56
56
@@ -84,7 +84,7 @@ public void toShouldMapFromSupplier() {
84
84
@ Test
85
85
public void asIntShouldAdaptSupplier () {
86
86
Integer result = this .map .from (() -> "123" ).asInt (Long ::valueOf )
87
- .toInstance (Integer ::new );
87
+ .toInstance (Integer ::valueOf );
88
88
assertThat (result ).isEqualTo (123 );
89
89
}
90
90
@@ -116,7 +116,7 @@ public void whenNonNullWhenSuppliedThrowsNullPointerExceptionShouldNotMap() {
116
116
117
117
@ Test
118
118
public void whenTrueWhenValueIsTrueShouldMap () {
119
- Boolean result = this .map .from (true ).whenTrue ().toInstance (Boolean ::new );
119
+ Boolean result = this .map .from (true ).whenTrue ().toInstance (Boolean ::valueOf );
120
120
assertThat (result ).isTrue ();
121
121
}
122
122
@@ -127,7 +127,7 @@ public void whenTrueWhenValueIsFalseShouldNotMap() {
127
127
128
128
@ Test
129
129
public void whenFalseWhenValueIsFalseShouldMap () {
130
- Boolean result = this .map .from (false ).whenFalse ().toInstance (Boolean ::new );
130
+ Boolean result = this .map .from (false ).whenFalse ().toInstance (Boolean ::valueOf );
131
131
assertThat (result ).isFalse ();
132
132
}
133
133
@@ -148,7 +148,7 @@ public void whenHasTextWhenValueIsEmptyShouldNotMap() {
148
148
149
149
@ Test
150
150
public void whenHasTextWhenValueHasTextShouldMap () {
151
- Integer result = this .map .from (123 ).whenHasText ().toInstance (Integer ::new );
151
+ Integer result = this .map .from (123 ).whenHasText ().toInstance (Integer ::valueOf );
152
152
assertThat (result ).isEqualTo (123 );
153
153
}
154
154
@@ -191,7 +191,7 @@ public void whenWhenValueDoesNotMatchShouldNotMap() {
191
191
public void whenWhenCombinedWithAsUsesSourceValue () {
192
192
Count <String > source = new Count <>(() -> "123" );
193
193
Long result = this .map .from (source ).when ("123" ::equals ).as (Integer ::valueOf )
194
- .when ((v ) -> v == 123 ).as (Integer ::longValue ).toInstance (Long ::new );
194
+ .when ((v ) -> v == 123 ).as (Integer ::longValue ).toInstance (Long ::valueOf );
195
195
assertThat (result ).isEqualTo (123 );
196
196
assertThat (source .getCount ()).isOne ();
197
197
}
0 commit comments