@VisibleForTesting
  List<String> getEntityTypes() throws IOException {
    LeveldbIterator iterator = null;
    try {
      iterator = getDbIterator(false);
      List<String> entityTypes = new ArrayList<String>();
      iterator.seek(ENTITY_ENTRY_PREFIX);
      while (iterator.hasNext()) {
        byte[] key = iterator.peekNext().getKey();
        if (key[0] != ENTITY_ENTRY_PREFIX[0]) {
          break;
        }
        KeyParser kp = new KeyParser(key,
            ENTITY_ENTRY_PREFIX.length);
        String entityType = kp.getNextString();
        entityTypes.add(entityType);
        byte[] lookupKey = KeyBuilder.newInstance().add(ENTITY_ENTRY_PREFIX)
            .add(entityType).getBytesForLookup();
        if (lookupKey[lookupKey.length - 1] != 0x0) {
          throw new IOException("Found unexpected end byte in lookup key");
        }
        lookupKey[lookupKey.length - 1] = 0x1;
        iterator.seek(lookupKey);
      }
      return entityTypes;
    } catch(DBException e) {
      throw new IOException(e);            	
    } finally {
      IOUtils.cleanupWithLogger(LOG, iterator);
    }
  }
@Test
  void testGetEntityTypes() throws IOException {
    List<String> entityTypes = ((LeveldbTimelineStore) store).getEntityTypes();
    assertEquals(7, entityTypes.size());
    assertEquals("ACL_ENTITY_TYPE_1", entityTypes.get(0));
    assertEquals("OLD_ENTITY_TYPE_1", entityTypes.get(1));
    assertEquals(entityType1, entityTypes.get(2));
    assertEquals(entityType2, entityTypes.get(3));
    assertEquals(entityType4, entityTypes.get(4));
    assertEquals(entityType5, entityTypes.get(5));
  }