code:     public void testWildcardBehaviour_snapshotRestore() throws Exception {
          createIndex("foobar");
          ensureGreen("foobar");
          waitForRelocation();
  
          PutRepositoryResponse putRepositoryResponse = client().admin().cluster().preparePutRepository("dummy-repo")
                  .setType("fs").setSettings(ImmutableSettings.settingsBuilder().put("location", newTempDir())).get();
          assertThat(putRepositoryResponse.isAcknowledged(), equalTo(true));
          client().admin().cluster().prepareCreateSnapshot("dummy-repo", "snap1").setWaitForCompletion(true).get();
  
          IndicesOptions options = IndicesOptions.fromOptions(false, false, true, false);
          verify(snapshot("snap2", "foo*", "bar*").setIndicesOptions(options), true);
          verify(restore("snap1", "foo*", "bar*").setIndicesOptions(options), true);
  
          options = IndicesOptions.strictExpandOpen();
          verify(snapshot("snap2", "foo*", "bar*").setIndicesOptions(options), false);
          verify(restore("snap2", "foo*", "bar*").setIndicesOptions(options), false);
  
          assertAcked(prepareCreate("barbaz"));
          //TODO: temporary work-around for #5531
          ensureGreen("barbaz");
          waitForRelocation();
          options = IndicesOptions.fromOptions(false, false, true, false);
          verify(snapshot("snap3", "foo*", "bar*").setIndicesOptions(options), false);
          verify(restore("snap3", "foo*", "bar*").setIndicesOptions(options), false);
  
          options = IndicesOptions.fromOptions(false, false, true, false);
          verify(snapshot("snap4", "foo*", "baz*").setIndicesOptions(options), true);
          verify(restore("snap3", "foo*", "baz*").setIndicesOptions(options), true);
      }
  
      @Test
  