public static List<Object> getFieldValues(Collection<Field> fields, Object o) {
    List<Object> results = new ArrayList<>(fields.size());
    for (Field field : fields) {
      // Platform.objectFieldOffset(field) can't handle primitive field.
      Object fieldValue = FieldAccessor.createAccessor(field).get(o);
      results.add(fieldValue);
    }
    return results;
  }
@Test
  public void testGetFieldValues() {
    GetFieldValuesTestClass o = new GetFieldValuesTestClass();
    o.f1 = "str";
    o.f2 = 10;
    List<Object> fieldValues =
        ReflectionUtils.getFieldValues(Descriptor.getFields(GetFieldValuesTestClass.class), o);
    assertEquals(fieldValues, ImmutableList.of("str", 10));
  }