public Set<String> keySet() {
    return members.keySet();
  }
@Test
  public void testKeySet() {
    JsonObject a = new JsonObject();
    assertThat(a.keySet()).hasSize(0);

    a.add("foo", new JsonArray());
    a.add("bar", new JsonObject());

    assertThat(a.size()).isEqualTo(2);
    assertThat(a.keySet()).hasSize(2);
    assertThat(a.keySet()).containsExactly("foo", "bar").inOrder();

    a.addProperty("1", true);
    a.addProperty("2", false);

    // Insertion order should be preserved by keySet()
    Deque<String> expectedKeys = new ArrayDeque<>(Arrays.asList("foo", "bar", "1", "2"));
    // Note: Must wrap in ArrayList because Deque implementations do not implement `equals`
    assertThat(new ArrayList<>(a.keySet())).isEqualTo(new ArrayList<>(expectedKeys));
    Iterator<String> iterator = a.keySet().iterator();

    // Remove keys one by one
    for (int i = a.size(); i >= 1; i--) {
      assertThat(iterator.hasNext()).isTrue();
      assertThat(iterator.next()).isEqualTo(expectedKeys.getFirst());
      iterator.remove();
      expectedKeys.removeFirst();

      assertThat(a.size()).isEqualTo(i - 1);
      assertThat(new ArrayList<>(a.keySet())).isEqualTo(new ArrayList<>(expectedKeys));
    }
  }