// Path: src/main/java/com/nebhale/jsonpath/internal/parser/PathCharacter.java
// enum CharacterType {
//     ARRAY_CLOSE, //
//     ARRAY_OPEN, //
//     COMMA, //
//     COMPLEX_NAME_CHARACTER, //
//     DIGIT, //
//     DOT, //
//     DOUBLE_QUOTE, //
//     END, //
//     HYPHEN, //
//     INDEX_CHARACTER, //
//     LETTER, //
//     QUOTE, //
//     ROOT, //
//     SIMPLE_NAME_CHARACTER, //
//     SPACE, //
//     UNDERSCORE, //
//     WILDCARD;
// }
// 
// Path: src/main/java/com/nebhale/jsonpath/internal/util/Sets.java
// public final class Sets {
// 
//     private Sets() {
//     }
// 
//     /**
//      * Creates a {@link Set} from a collection of items
//      *
//      * @param items The items to create the set from
//      * @return The set created from the collection of items
//      */
//     public static <T> Set<T> asSet(T... items) {
//         Set<T> set = new HashSet<T>();
//         for (T item : items) {
//             set.add(item);
//         }
//         return set;
//     }
// }
// 
// Path: src/test/java/com/nebhale/jsonpath/testutils/EqualsAndHashCodeTestUtils.java
// public final class EqualsAndHashCodeTestUtils<T> {
// 
//     private final T control;
// 
//     /**
//      * Creates an instance of this utility with an {@link Object} to use as a control instance. Ensures the following
//      * 
//      * <ul>
//      * <li>{@code control}'s type is not {@link Object}</li>
//      * <li>{@code control} is not equal to a different type</li>
//      * <li>{@code control} is not equal to null</li>
//      * <li>{@code control} is equal to itself</li>
//      * </ul>
//      * 
//      * @param control The {@link Object} to use as a control instance
//      */
//     public EqualsAndHashCodeTestUtils(T control) {
//         this.control = control;
// 
//         assertFalse("control type cannot be Object", Object.class.getClass().equals(this.control.getClass()));
//         assertFalse("control is equal to a different type", this.control.equals(new Object()));
//         assertFalse("control is equal to null", this.control.equals(null));
//         assertTrue("control is not equal to itself", this.control.equals(this.control));
//     }
// 
//     /**
//      * Asserts that an instance is equal to the control instance. This means the following
//      * 
//      * <ul>
//      * <li>{@code control} is equal to {@code equal}</li>
//      * <li>{@code equal} is equal to {@code}</li>
//      * <li>{@code control}'s hash code is equal to {@code equal}'s hash code</li>
//      * </ul>
//      * 
//      * @param equals The instances that should be equal to the control instance
//      * 
//      * @return The called instance to allow chained invocation
//      */
//     public EqualsAndHashCodeTestUtils<T> assertEqual(T... equals) {
//         for (T equal : equals) {
//             assertTrue(String.format("'%s' was not equal to '%s'", this.control, equal), this.control.equals(equal));
//             assertTrue(String.format("'%s' was not equal to '%s'", equal, this.control), equal.equals(this.control));
//             assertTrue(String.format("The hash code of '%s' was not equal to the hash code of '%s'", this.control, equal),
//                 this.control.hashCode() == equal.hashCode());
//         }
//         return this;
//     }
// 
//     /**
//      * Asserts that an instance is not equal to the control instance. This means the following
//      * 
//      * <ul>
//      * <li>{@code control} is not equal to {@code notEqual}</li>
//      * <li>{@code notEqual} is not equal to {@code}</li>
//      * <li>{@code control}'s hash code is not equal to {@code notEqual}'s hash code</li>
//      * </ul>
//      * 
//      * @param notEquals The instances that should not be equal to the control instance
//      * 
//      * @return The called instance to allow chained invocation
//      */
//     public EqualsAndHashCodeTestUtils<T> assertNotEqual(T... notEquals) {
//         for (Object notEqual : notEquals) {
//             assertFalse(String.format("'%s' was equal to '%s'", this.control, notEqual), this.control.equals(notEqual));
//             assertFalse(String.format("'%s' was equal to '%s'", notEqual, this.control), notEqual.equals(this.control));
//             assertFalse(String.format("The hash code of '%s' was equal to the hash code of '%s'", this.control, notEqual),
//                 this.control.hashCode() == notEqual.hashCode());
//         }
//         return this;
//     }
// 
// }


import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import com.nebhale.jsonpath.internal.parser.PathCharacter.CharacterType;
import com.nebhale.jsonpath.internal.util.Sets;
import com.nebhale.jsonpath.testutils.EqualsAndHashCodeTestUtils;
/*
 * Copyright 2013 the original author or authors.
 *
 * 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.nebhale.jsonpath.internal.parser;




public final class PathCharacterTest {

    @Test
    public void test() {
        PathCharacter pathCharacter = new PathCharacter(Sets.asSet(CharacterType.ROOT), '$', 0);

        assertTrue(pathCharacter.isType(CharacterType.ROOT));
        assertEquals('$', pathCharacter.getValue());
        assertEquals(0, pathCharacter.getPosition());
    }

    @Test
// Path: src/main/java/com/nebhale/jsonpath/internal/parser/PathCharacter.java
// enum CharacterType {
//     ARRAY_CLOSE, //
//     ARRAY_OPEN, //
//     COMMA, //
//     COMPLEX_NAME_CHARACTER, //
//     DIGIT, //
//     DOT, //
//     DOUBLE_QUOTE, //
//     END, //
//     HYPHEN, //
//     INDEX_CHARACTER, //
//     LETTER, //
//     QUOTE, //
//     ROOT, //
//     SIMPLE_NAME_CHARACTER, //
//     SPACE, //
//     UNDERSCORE, //
//     WILDCARD;
// }
// 
// Path: src/main/java/com/nebhale/jsonpath/internal/util/Sets.java
// public final class Sets {
// 
//     private Sets() {
//     }
// 
//     /**
//      * Creates a {@link Set} from a collection of items
//      *
//      * @param items The items to create the set from
//      * @return The set created from the collection of items
//      */
//     public static <T> Set<T> asSet(T... items) {
//         Set<T> set = new HashSet<T>();
//         for (T item : items) {
//             set.add(item);
//         }
//         return set;
//     }
// }
// 
// Path: src/test/java/com/nebhale/jsonpath/testutils/EqualsAndHashCodeTestUtils.java
// public final class EqualsAndHashCodeTestUtils<T> {
// 
//     private final T control;
// 
//     /**
//      * Creates an instance of this utility with an {@link Object} to use as a control instance. Ensures the following
//      * 
//      * <ul>
//      * <li>{@code control}'s type is not {@link Object}</li>
//      * <li>{@code control} is not equal to a different type</li>
//      * <li>{@code control} is not equal to null</li>
//      * <li>{@code control} is equal to itself</li>
//      * </ul>
//      * 
//      * @param control The {@link Object} to use as a control instance
//      */
//     public EqualsAndHashCodeTestUtils(T control) {
//         this.control = control;
// 
//         assertFalse("control type cannot be Object", Object.class.getClass().equals(this.control.getClass()));
//         assertFalse("control is equal to a different type", this.control.equals(new Object()));
//         assertFalse("control is equal to null", this.control.equals(null));
//         assertTrue("control is not equal to itself", this.control.equals(this.control));
//     }
// 
//     /**
//      * Asserts that an instance is equal to the control instance. This means the following
//      * 
//      * <ul>
//      * <li>{@code control} is equal to {@code equal}</li>
//      * <li>{@code equal} is equal to {@code}</li>
//      * <li>{@code control}'s hash code is equal to {@code equal}'s hash code</li>
//      * </ul>
//      * 
//      * @param equals The instances that should be equal to the control instance
//      * 
//      * @return The called instance to allow chained invocation
//      */
//     public EqualsAndHashCodeTestUtils<T> assertEqual(T... equals) {
//         for (T equal : equals) {
//             assertTrue(String.format("'%s' was not equal to '%s'", this.control, equal), this.control.equals(equal));
//             assertTrue(String.format("'%s' was not equal to '%s'", equal, this.control), equal.equals(this.control));
//             assertTrue(String.format("The hash code of '%s' was not equal to the hash code of '%s'", this.control, equal),
//                 this.control.hashCode() == equal.hashCode());
//         }
//         return this;
//     }
// 
//     /**
//      * Asserts that an instance is not equal to the control instance. This means the following
//      * 
//      * <ul>
//      * <li>{@code control} is not equal to {@code notEqual}</li>
//      * <li>{@code notEqual} is not equal to {@code}</li>
//      * <li>{@code control}'s hash code is not equal to {@code notEqual}'s hash code</li>
//      * </ul>
//      * 
//      * @param notEquals The instances that should not be equal to the control instance
//      * 
//      * @return The called instance to allow chained invocation
//      */
//     public EqualsAndHashCodeTestUtils<T> assertNotEqual(T... notEquals) {
//         for (Object notEqual : notEquals) {
//             assertFalse(String.format("'%s' was equal to '%s'", this.control, notEqual), this.control.equals(notEqual));
//             assertFalse(String.format("'%s' was equal to '%s'", notEqual, this.control), notEqual.equals(this.control));
//             assertFalse(String.format("The hash code of '%s' was equal to the hash code of '%s'", this.control, notEqual),
//                 this.control.hashCode() == notEqual.hashCode());
//         }
//         return this;
//     }
// 
// }


// Path: src/test/java/com/nebhale/jsonpath/internal/parser/PathCharacterTest.java
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import com.nebhale.jsonpath.internal.parser.PathCharacter.CharacterType;
import com.nebhale.jsonpath.internal.util.Sets;
import com.nebhale.jsonpath.testutils.EqualsAndHashCodeTestUtils;

/*
 * Copyright 2013 the original author or authors.
 *
 * 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.nebhale.jsonpath.internal.parser;




public final class PathCharacterTest {

    @Test
    public void test() {
        PathCharacter pathCharacter = new PathCharacter(Sets.asSet(CharacterType.ROOT), '$', 0);

        assertTrue(pathCharacter.isType(CharacterType.ROOT));
        assertEquals('$', pathCharacter.getValue());
        assertEquals(0, pathCharacter.getPosition());
    }

    @Test
    public void equalsHashCode() {