### Question:
DynamoSchema { public Set<DynamoIndex> getGlobalSecondaryIndexes() { return getIndexes().stream() .filter(index -> index.getIndexType().equals(IndexType.GLOBAL_SECONDARY_INDEX)) .collect(toLinkedHashSet()); }  TypeElement getDocumentElement(); DynamoIndex getTableIndex(); Set<DynamoIndex> getLocalSecondaryIndexes(); boolean hasLocalSecondaryIndexes(); Set<DynamoIndex> getGlobalSecondaryIndexes(); boolean hasGlobalSecondaryIndexes();  }### Answer:
@Test void getGlobalSecondaryIndexes_none_returnsEmptySet() { assertThat(schema().build().getGlobalSecondaryIndexes()).isEmpty(); }
@Test void getGlobalSecondaryIndexes_singleIndex_returnsIndex() { DynamoIndex gsi = index() .indexType(IndexType.GLOBAL_SECONDARY_INDEX) .build(); DynamoSchema schema = schema() .indexes(singleton(gsi)) .build(); assertThat(schema.getGlobalSecondaryIndexes()).containsExactly(gsi); }
@Test void getGlobalSecondaryIndexes_multipleIndexes_returnsIndexesInOrder() { DynamoIndex gsi1 = index() .name("gsi1") .indexType(IndexType.GLOBAL_SECONDARY_INDEX) .build(); DynamoIndex gsi2 = index() .name("gsi2") .indexType(IndexType.GLOBAL_SECONDARY_INDEX) .build(); DynamoSchema schema = schema() .indexes(setOf(gsi1, gsi2)) .build(); assertThat(schema.getGlobalSecondaryIndexes()).containsExactly(gsi1, gsi2); }