/*
 * This file is part of SpongeAPI, licensed under the MIT License (MIT).
 *
 * Copyright (c) SpongePowered <https://www.spongepowered.org>
 * Copyright (c) contributors
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package org.spongepowered.api.event;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.when;

import com.google.common.collect.Lists;
import org.junit.Test;
import org.spongepowered.api.block.BlockSnapshot;
import org.spongepowered.api.data.DataHolder;
import org.spongepowered.api.data.DataTransactionResult;
import org.spongepowered.api.data.Transaction;
import org.spongepowered.api.event.block.ChangeBlockEvent;
import org.spongepowered.api.event.data.ChangeDataHolderEvent;
import org.spongepowered.api.world.ServerLocation;
import org.spongepowered.api.world.server.ServerWorld;
import org.spongepowered.math.vector.Vector3d;

import java.util.Optional;

public class SpongeAbstractEventTest {

//    @Test
    public void testChangeBlockEvent_filter() {
        Transaction<BlockSnapshot> transaction = new Transaction<>(mockParam(BlockSnapshot.class), mockParam(BlockSnapshot.class));

        when(transaction.getOriginal().getLocation()).thenReturn(Optional.of(
            ServerLocation.of(mockParam(ServerWorld.class), Vector3d.ZERO)));

        ChangeBlockEvent.Break event = SpongeEventFactory.createChangeBlockEventBreak(
            Cause.of(EventContext.empty(), "none"), Lists.newArrayList(transaction));
        event.filter(location -> false);

        assertThat(transaction.isValid(), is(false));
    }

    @Test
    public void testValueChangeEvent() {
        DataTransactionResult original = DataTransactionResult.failNoData();
        DataTransactionResult modified = DataTransactionResult.successNoData();

        ChangeDataHolderEvent.ValueChange event = SpongeEventFactory.createChangeDataHolderEventValueChange(
            Cause.of(EventContext.empty(), "none"), original, mockParam(DataHolder.Mutable.class));

        assertThat(event.getOriginalChanges(), is(equalTo(original)));

        event.proposeChanges(modified);
        assertThat(event.getEndResult(), is(equalTo(modified)));
    }

    @SuppressWarnings("unchecked")
    private <T> T mockParam(Class<T> clazz) {
        return (T) SpongeEventFactoryTest.mockParam(clazz);
    }
}

@@ -1422,88 +1422,8 @@
 at;%0A
-import static org.mockito.Mockito.when;%0A%0Aimport com.google.common.collect.Lists;
 %0Aimp
@@ -1446,58 +1446,8 @@
 st;%0A
-import org.spongepowered.api.block.BlockSnapshot;%0A
 impo
@@ -1578,988 +1578,143 @@
 api.
-data.Transaction;%0Aimport org.spongepowered.api.event.block.ChangeBlockEvent;%0Aimport org.spongepowered.api.event.data.ChangeDataHolderEvent;%0Aimport org.spongepowered.api.world.ServerLocation;%0Aimport org.spongepowered.api.world.server.ServerWorld;%0Aimport org.spongepowered.math.vector.Vector3d;%0A%0Aimport java.util.Optional;%0A%0Apublic class SpongeAbstractEventTest %7B%0A%0A//    @Test%0A    public void testChangeBlockEvent_filter() %7B%0A        Transaction%3CBlockSnapshot%3E transaction = new Transaction%3C%3E(mockParam(BlockSnapshot.class), mockParam(BlockSnapshot.class));%0A%0A        when(transaction.getOriginal().getLocation()).thenReturn(Optional.of(%0A            ServerLocation.of(mockParam(ServerWorld.class), Vector3d.ZERO)));%0A%0A        ChangeBlockEvent.Break event = SpongeEventFactory.createChangeBlockEventBreak(%0A            Cause.of(EventContext.empty(), %22none%22), Lists.newArrayList(transaction));%0A        event.filter(location -%3E false);%0A%0A        assertThat(transaction.isValid(), is(false));
+event.data.ChangeDataHolderEvent;%0A%0Apublic class SpongeAbstractEventTest %7B%0A%0A//    @Test%0A    public void testChangeBlockEvent_filter() %7B%0A
 %0A   

Remove dead test code