Changeset 10638 in josm for trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReaderTest.java
- Timestamp:
- 2016-07-25T21:19:38+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReaderTest.java
r10378 r10638 5 5 import static org.junit.Assert.assertEquals; 6 6 import static org.junit.Assert.assertThat; 7 import static org.junit.Assert.assertTrue; 7 8 8 9 import java.io.IOException; 9 10 import java.util.Collection; 10 11 import java.util.List; 12 import java.util.stream.Collectors; 11 13 12 14 import org.junit.Assert; … … 17 19 import org.openstreetmap.josm.gui.tagging.presets.items.Check; 18 20 import org.openstreetmap.josm.gui.tagging.presets.items.Key; 19 import org.openstreetmap.josm.tools.Utils;20 21 import org.xml.sax.SAXException; 21 22 … … 59 60 assertThat(presets, hasSize(1)); 60 61 final TaggingPreset abc = presets.iterator().next(); 61 final List<String> keys = Utils.transform(abc.data, new Utils.Function<TaggingPresetItem, String>() { 62 @Override 63 public String apply(TaggingPresetItem x) { 64 return x instanceof Key ? ((Key) x).key : null; 65 } 66 }); 62 assertTrue(abc.data.stream().allMatch(Key.class::isInstance)); 63 final List<String> keys = abc.data.stream().map(x -> ((Key) x).key).collect(Collectors.toList()); 67 64 assertEquals("[A1, A2, A3, B1, B2, B3, C1, C2, C3]", keys.toString()); 68 65 }
Note:
See TracChangeset
for help on using the changeset viewer.