// Path: gremlin-objects/src/test/java/org/apache/tinkerpop/gremlin/object/vertices/Location.java
// public static Instant year(int value) {
//   Instant instant = years.get(value);
//   if (instant != null) {
//     return instant;
//   }
//   instant = LocalDate.parse(String.format("%s-01-01", value)).atStartOfDay()
//       .toInstant(ZoneOffset.UTC);
//   years.put(value, instant);
//   return instant;
// }
// 
// Path: gremlin-objects/src/main/java/org/apache/tinkerpop/gremlin/object/reflect/Properties.java
// @SuppressWarnings({"PMD.ShortMethodName"})
// public static <E extends Element> Object[] all(E element) {
//   return of(element, field -> true);
// }
// 
// Path: gremlin-objects/src/main/java/org/apache/tinkerpop/gremlin/object/reflect/Properties.java
// @SuppressWarnings({"PMD.ShortMethodName"})
// public static <E extends Element> Object[] id(E element) {
//   return of(element, Keys::isKey);
// }
// 
// Path: gremlin-objects/src/main/java/org/apache/tinkerpop/gremlin/object/reflect/Properties.java
// public static List<Property> list(Object... objects) {
//   List<Property> properties = new ArrayList<>();
//   for (int i = 0; i < objects.length; i = i + 2) {
//     String key = (String) objects[i];
//     Object value = objects[i + 1];
//     properties.add(new DetachedProperty<>(key, value));
//   }
//   return properties;
// }
// 
// Path: gremlin-objects/src/main/java/org/apache/tinkerpop/gremlin/object/reflect/Properties.java
// public static <E extends Element> List<String> names(E element) {
//   return names(element, field -> true);
// }
// 
// Path: gremlin-objects/src/main/java/org/apache/tinkerpop/gremlin/object/reflect/Properties.java
// @SuppressWarnings({"PMD.ShortMethodName"})
// public static <V extends Vertex> Object[] of(V vertex) {
//   return of(vertex, field -> !isKey(field));
// }
// 
// Path: gremlin-objects/src/main/java/org/apache/tinkerpop/gremlin/object/reflect/Properties.java
// @SneakyThrows
// @SuppressWarnings("unchecked")
// public static List<Object> values(Object object) {
//   List<Object> properties = new ArrayList<>();
//   Class<?> objectClass = object.getClass();
//   if (isPrimitive(objectClass)) {
//     properties.add(object);
//   } else if (isElement(objectClass)) {
//     for (Field field : fields((Class<? extends Element>) objectClass)) {
//       Object value = propertyValue(field, object);
//       if (isMissing(value)) {
//         continue;
//       }
//       String propertyName = propertyKey(field);
//       // add property name iff this field is not the meta-properties value field
//       if (isPropertyValue(field)) {
//         properties.add(0, value);
//       } else {
//         properties.add(propertyName);
//         properties.add(value);
//       }
//     }
//   }
//   return properties;
// }


import static org.apache.tinkerpop.gremlin.object.reflect.Properties.values;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import org.apache.tinkerpop.gremlin.structure.Property;
import org.junit.Test;
import java.time.Instant;
import java.util.Arrays;
import static org.apache.tinkerpop.gremlin.object.vertices.Location.year;
import static org.apache.tinkerpop.gremlin.object.reflect.Properties.all;
import static org.apache.tinkerpop.gremlin.object.reflect.Properties.id;
import static org.apache.tinkerpop.gremlin.object.reflect.Properties.list;
import static org.apache.tinkerpop.gremlin.object.reflect.Properties.names;
import static org.apache.tinkerpop.gremlin.object.reflect.Properties.of;

  @Test
  public void testPropertyAll() {
    assertArrayEquals(new Object[] {"name", "marko", "age", 29}, all(marko));
    assertArrayEquals(new Object[] {"since", year(2000)}, all(develops));
  }

  @Test
  public void testPropertyOf() {
    assertArrayEquals(new Object[] {}, of(marko));
    assertArrayEquals(new Object[] {"since", year(2000)}, of(develops));
  }

  @Test
  public void testPropertyNames() {
    assertEquals(Arrays.asList("name", "age", "locations", "titles"), names(marko));
    assertEquals(Arrays.asList("since"), names(develops));
  }

  @Test
  public void testPropertyValues() {
    assertEquals(Arrays.asList("san diego", "startTime", year(2000)), values(location));
    assertEquals(Arrays.asList("since", year(2000)), values(develops));

  }

  @Test
  @SuppressWarnings("unchecked")
  public void testPropertyLists() {
    Property<Instant> since = list(of(develops)).get(0);
// Path: gremlin-objects/src/test/java/org/apache/tinkerpop/gremlin/object/vertices/Location.java
// public static Instant year(int value) {
//   Instant instant = years.get(value);
//   if (instant != null) {
//     return instant;
//   }
//   instant = LocalDate.parse(String.format("%s-01-01", value)).atStartOfDay()
//       .toInstant(ZoneOffset.UTC);
//   years.put(value, instant);
//   return instant;
// }
// 
// Path: gremlin-objects/src/main/java/org/apache/tinkerpop/gremlin/object/reflect/Properties.java
// @SuppressWarnings({"PMD.ShortMethodName"})
// public static <E extends Element> Object[] all(E element) {
//   return of(element, field -> true);
// }
// 
// Path: gremlin-objects/src/main/java/org/apache/tinkerpop/gremlin/object/reflect/Properties.java
// @SuppressWarnings({"PMD.ShortMethodName"})
// public static <E extends Element> Object[] id(E element) {
//   return of(element, Keys::isKey);
// }
// 
// Path: gremlin-objects/src/main/java/org/apache/tinkerpop/gremlin/object/reflect/Properties.java
// public static List<Property> list(Object... objects) {
//   List<Property> properties = new ArrayList<>();
//   for (int i = 0; i < objects.length; i = i + 2) {
//     String key = (String) objects[i];
//     Object value = objects[i + 1];
//     properties.add(new DetachedProperty<>(key, value));
//   }
//   return properties;
// }
// 
// Path: gremlin-objects/src/main/java/org/apache/tinkerpop/gremlin/object/reflect/Properties.java
// public static <E extends Element> List<String> names(E element) {
//   return names(element, field -> true);
// }
// 
// Path: gremlin-objects/src/main/java/org/apache/tinkerpop/gremlin/object/reflect/Properties.java
// @SuppressWarnings({"PMD.ShortMethodName"})
// public static <V extends Vertex> Object[] of(V vertex) {
//   return of(vertex, field -> !isKey(field));
// }
// 
// Path: gremlin-objects/src/main/java/org/apache/tinkerpop/gremlin/object/reflect/Properties.java
// @SneakyThrows
// @SuppressWarnings("unchecked")
// public static List<Object> values(Object object) {
//   List<Object> properties = new ArrayList<>();
//   Class<?> objectClass = object.getClass();
//   if (isPrimitive(objectClass)) {
//     properties.add(object);
//   } else if (isElement(objectClass)) {
//     for (Field field : fields((Class<? extends Element>) objectClass)) {
//       Object value = propertyValue(field, object);
//       if (isMissing(value)) {
//         continue;
//       }
//       String propertyName = propertyKey(field);
//       // add property name iff this field is not the meta-properties value field
//       if (isPropertyValue(field)) {
//         properties.add(0, value);
//       } else {
//         properties.add(propertyName);
//         properties.add(value);
//       }
//     }
//   }
//   return properties;
// }


// Path: gremlin-objects/src/test/java/org/apache/tinkerpop/gremlin/object/reflect/PropertiesTest.java
import static org.apache.tinkerpop.gremlin.object.reflect.Properties.values;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import org.apache.tinkerpop.gremlin.structure.Property;
import org.junit.Test;
import java.time.Instant;
import java.util.Arrays;
import static org.apache.tinkerpop.gremlin.object.vertices.Location.year;
import static org.apache.tinkerpop.gremlin.object.reflect.Properties.all;
import static org.apache.tinkerpop.gremlin.object.reflect.Properties.id;
import static org.apache.tinkerpop.gremlin.object.reflect.Properties.list;
import static org.apache.tinkerpop.gremlin.object.reflect.Properties.names;
import static org.apache.tinkerpop.gremlin.object.reflect.Properties.of;


  @Test
  public void testPropertyAll() {
    assertArrayEquals(new Object[] {"name", "marko", "age", 29}, all(marko));
    assertArrayEquals(new Object[] {"since", year(2000)}, all(develops));
  }

  @Test
  public void testPropertyOf() {
    assertArrayEquals(new Object[] {}, of(marko));
    assertArrayEquals(new Object[] {"since", year(2000)}, of(develops));
  }

  @Test
  public void testPropertyNames() {
    assertEquals(Arrays.asList("name", "age", "locations", "titles"), names(marko));
    assertEquals(Arrays.asList("since"), names(develops));
  }

  @Test
  public void testPropertyValues() {
    assertEquals(Arrays.asList("san diego", "startTime", year(2000)), values(location));
    assertEquals(Arrays.asList("since", year(2000)), values(develops));

  }

  @Test
  @SuppressWarnings("unchecked")
  public void testPropertyLists() {
    Property<Instant> since = list(of(develops)).get(0);
    assertEquals("since", since.key());