class Location extends Vector3Impl {

    public Location setZ(double z) {
        return new Location(extent, this.withZ(z), yaw, pitch);
    }

}

class LocationTest {

    private static final int TEST_VALUE;
    private static final double EPSILON;

    @Test
    public void testSetZ() throws Exception {

        World world = mock(World.class);
        Location location1 = new Location(world, Vector3.ZERO);
        Location location2 = location1.setZ(TEST_VALUE);
        assertEquals(0, location1.getZ(), EPSILON);
        assertEquals(0, location2.getX(), EPSILON);
        assertEquals(0, location2.getY(), EPSILON);
        assertEquals(TEST_VALUE, location2.getZ(), EPSILON);
    }

}