// Path: src/main/java/com/shapesecurity/functional/F.java
// @CheckReturnValue
// @FunctionalInterface
// public interface F<A, R> {
//     @Nonnull
//     static <A extends B, B> F<A, B> id() {
//         return o -> o;
//     }
// 
//     @Nonnull
//     static <A, B> F<A, B> constant(@Nonnull final B b) {
//         return a -> b;
//     }
// 
//     @Nonnull
//     static <A, B, C> F2<A, B, C> uncurry(@Nonnull final F<A, F<B, C>> f) {
//         return (a, b) -> f.apply(a).apply(b);
//     }
// 
//     @Nonnull
//     static <A, B, C> F<B, F<A, C>> flip(@Nonnull final F<A, F<B, C>> f) {
//         return b -> a -> f.apply(a).apply(b);
//     }
// 
//     @Nonnull
//     R apply(@Nonnull A a);
// 
//     @Nonnull
//     default <C> F<C, R> compose(@Nonnull final F<C, A> f) {
//         return c -> this.apply(f.apply(c));
//     }
// 
// 
//     @Nonnull
//     default <B> F<A, B> then(@Nonnull final F<R, B> f) {
//         return c -> f.apply(this.apply(c));
//     }
// }


import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import com.shapesecurity.functional.F;
import org.junit.Test;
/*
 * Copyright 2014 Shape Security, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.shapesecurity.functional.data;




public class EitherTest {
    @Test
    public void simpleTests() {
        Either<String, Integer> e1 = Either.left("a");
        Either<String, Integer> e2 = Either.right(1);
        F<Integer, Integer> plusOne = integer -> integer + 1;

        assertTrue(e1.isLeft());
        assertFalse(e1.isRight());
        assertFalse(e2.isLeft());
// Path: src/main/java/com/shapesecurity/functional/F.java
// @CheckReturnValue
// @FunctionalInterface
// public interface F<A, R> {
//     @Nonnull
//     static <A extends B, B> F<A, B> id() {
//         return o -> o;
//     }
// 
//     @Nonnull
//     static <A, B> F<A, B> constant(@Nonnull final B b) {
//         return a -> b;
//     }
// 
//     @Nonnull
//     static <A, B, C> F2<A, B, C> uncurry(@Nonnull final F<A, F<B, C>> f) {
//         return (a, b) -> f.apply(a).apply(b);
//     }
// 
//     @Nonnull
//     static <A, B, C> F<B, F<A, C>> flip(@Nonnull final F<A, F<B, C>> f) {
//         return b -> a -> f.apply(a).apply(b);
//     }
// 
//     @Nonnull
//     R apply(@Nonnull A a);
// 
//     @Nonnull
//     default <C> F<C, R> compose(@Nonnull final F<C, A> f) {
//         return c -> this.apply(f.apply(c));
//     }
// 
// 
//     @Nonnull
//     default <B> F<A, B> then(@Nonnull final F<R, B> f) {
//         return c -> f.apply(this.apply(c));
//     }
// }


// Path: src/test/java/com/shapesecurity/functional/data/EitherTest.java
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import com.shapesecurity.functional.F;
import org.junit.Test;

/*
 * Copyright 2014 Shape Security, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.shapesecurity.functional.data;




public class EitherTest {
    @Test
    public void simpleTests() {
        Either<String, Integer> e1 = Either.left("a");
        Either<String, Integer> e2 = Either.right(1);
        F<Integer, Integer> plusOne = integer -> integer + 1;

        assertTrue(e1.isLeft());
        assertFalse(e1.isRight());
        assertFalse(e2.isLeft());
        assertTrue(e2.isRight());