### Question:
EntityTable implements Closeable { public long getId(String type, @Nullable String name) { if (name == null) { return 0; } return entityCache.getUnchecked(new EntityName(type, name)) % maxId; } EntityTable(MetricsTable table);   EntityTable(MetricsTable table, long maxId); long getId(String type, @Nullable String name); @Nullable String getName(long id, String type); int getIdSize(); @Override void close();  }### Answer:
@Test public void testGetId() throws Exception { InMemoryTableService.create("testGetId"); MetricsTable table = new InMemoryMetricsTable("testGetId"); EntityTable entityTable = new EntityTable(table); for (int i = 1; i <= 10; i++) { Assert.assertEquals((long) i, entityTable.getId("app", "app" + i)); } for (int i = 1; i <= 10; i++) { Assert.assertEquals((long) i, entityTable.getId("app", "app" + i)); } entityTable = new EntityTable(table); for (int i = 1; i <= 10; i++) { Assert.assertEquals((long) i, entityTable.getId("app", "app" + i)); } for (int i = 1; i <= 10; i++) { Assert.assertEquals((long) i, entityTable.getId("flow", "flow" + i)); } }