@Override
    @CheckReturnValue
    public boolean flushAndResetMap() {
        if (!initCurrentMap()) {
            return false;
        }

        for (int i = 0; i < buffers.length; i++) {
            if (!flushPartition(i)) {
                return false;
            }
        }

        // we're done
        currentMap = null;
        if (logger.isFineEnabled()) {
            logger.fine("Stats for %s: keys=%,d, chunks=%,d, bytes=%,d",
                    vertexName, totalKeys, totalChunks, totalPayloadBytes);
        }
        return true;
    }
@Test
    public void when_noItemsAndNoCurrentMap_then_flushAndResetReturnsFalse() {
        snapshotContext.setCurrentMapName(null);
        assertFalse(writer.flushAndResetMap());
        snapshotContext.setCurrentMapName("map1");
    }