Changeset 10717 in josm for trunk/test/unit


Ignore:
Timestamp:
2016-08-03T15:39:00+02:00 (8 years ago)
Author:
simon04
Message:

see #11390, see #12890 - Lambda can be replaced with method reference

Location:
trunk/test/unit/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/io/OsmWriterTest.java

    r10638 r10717  
    3232        Collections.sort(ids, OsmWriter.byIdComparator);
    3333
    34         final long[] longIds = ids.stream().mapToLong(x -> x.getUniqueId()).toArray();
     34        final long[] longIds = ids.stream().mapToLong(NodeData::getUniqueId).toArray();
    3535        assertArrayEquals(new long[] {
    3636                -3, -12, -20, -9223372036854775808L, 0, 2, 12, 65, 9223372036854775807L
  • trunk/test/unit/org/openstreetmap/josm/tools/MemoryManagerTest.java

    r10588 r10717  
    4848        assertTrue(testMemory.toString().startsWith("MemoryHandle"));
    4949
    50         manager.allocateMemory("test2", 10, () -> new Object());
     50        manager.allocateMemory("test2", 10, Object::new);
    5151        assertEquals(available - 20, manager.getAvailableMemory());
    5252
     
    6262    public void testUseAfterFree() throws NotEnoughMemoryException {
    6363        MemoryManager manager = MemoryManager.getInstance();
    64         MemoryHandle<Object> testMemory = manager.allocateMemory("test", 10, () -> new Object());
     64        MemoryHandle<Object> testMemory = manager.allocateMemory("test", 10, Object::new);
    6565        testMemory.free();
    6666        testMemory.get();
     
    7474    public void testFreeAfterFree() throws NotEnoughMemoryException {
    7575        MemoryManager manager = MemoryManager.getInstance();
    76         MemoryHandle<Object> testMemory = manager.allocateMemory("test", 10, () -> new Object());
     76        MemoryHandle<Object> testMemory = manager.allocateMemory("test", 10, Object::new);
    7777        testMemory.free();
    7878        testMemory.free();
     
    136136        assertTrue(manager.resetState().isEmpty());
    137137
    138         manager.allocateMemory("test", 10, () -> new Object());
    139         manager.allocateMemory("test2", 10, () -> new Object());
     138        manager.allocateMemory("test", 10, Object::new);
     139        manager.allocateMemory("test2", 10, Object::new);
    140140        assertEquals(2, manager.resetState().size());
    141141
     
    150150    public void testResetStateUseAfterFree() throws NotEnoughMemoryException {
    151151        MemoryManager manager = MemoryManager.getInstance();
    152         MemoryHandle<Object> testMemory = manager.allocateMemory("test", 10, () -> new Object());
     152        MemoryHandle<Object> testMemory = manager.allocateMemory("test", 10, Object::new);
    153153
    154154        assertFalse(manager.resetState().isEmpty());
Note: See TracChangeset for help on using the changeset viewer.