### Question:
InvertedIndexTagStore implements TagStore { @Override public int getOrCreate(final Metric m) { Optional<Integer> optionalMetric = get(m); return optionalMetric.isPresent() ? optionalMetric.get() : create(m); } InvertedIndexTagStore();  InvertedIndexTagStore(int metricIdMapCapacity, int initialIndexSize);  InvertedIndexTagStore(int metricIdMapCapacity, int initialIndexSize,
                               String dataDirectory);  InvertedIndexTagStore(int metricIdMapCapacity, int initialIndexSize,
                               String dataDirectory, boolean useOffHeapIdStore,
                               boolean useOffHeapIndexStore); @Override Optional<Integer> get(Metric m); @Override List<Integer> lookup(Query q); RoaringBitmap lookupMetricIndex(String key); @VisibleForTesting Map<Integer, String> getValuesForMetricKey(String metricName, String key); @Override int getOrCreate(final Metric m); @Override String getMetricName(final int metricId); @Override Map<String, Object> getStats(); @Override void close(); @Override boolean isReadOnly(); String getMetricNameFromId(final int id);  }### Answer:
@Test(expected = PatternSyntaxException.class) public void testFailedRegExQuery() { ids.add(store.getOrCreate( new Metric(METRIC1, Collections.singletonList("host=ogg-01.ops.ankh.morpork.com")))); query(makeRegExQuery(METRIC1, HOST_TAG, "ogg-\\d(3.ops.ankh.morpork.com")); }