### Question:
RegionRouteTable { public Region findRegionByKey(final byte[] key) { Requires.requireNonNull(key, "key"); final StampedLock stampedLock = this.stampedLock; final long stamp = stampedLock.readLock(); try { return findRegionByKeyWithoutLock(key); } finally { stampedLock.unlockRead(stamp); } }  Region getRegionById(final long regionId); void addOrUpdateRegion(final Region region); void splitRegion(final long leftId, final Region right); boolean removeRegion(final long regionId); Region findRegionByKey(final byte[] key); Map<Region, List<byte[]>> findRegionsByKeys(final List<byte[]> keys); Map<Region, List<KVEntry>> findRegionsByKvEntries(final List<KVEntry> kvEntries); List<Region> findRegionsByKeyRange(final byte[] startKey, final byte[] endKey); byte[] findStartKeyOfNextRegion(final byte[] key);  }### Answer:
@Test public void findRegionByKeyTest() { { RegionRouteTable table = new RegionRouteTable(); Region region = makeRegion(-1, null, null); table.addOrUpdateRegion(region); Region found = table.findRegionByKey(new byte[0]); assertEquals(region, found); } { RegionRouteTable table = new RegionRouteTable(); Region r1 = makeRegion(1, null, KeyValueTool.makeKey("c")); Region r2 = makeRegion(2, KeyValueTool.makeKey("c"), KeyValueTool.makeKey("e")); Region r3 = makeRegion(3, KeyValueTool.makeKey("e"), null); table.addOrUpdateRegion(r1); table.addOrUpdateRegion(r2); table.addOrUpdateRegion(r3); Region found = table.findRegionByKey(KeyValueTool.makeKey("abs")); assertEquals(r1.getId(), found.getId()); found = table.findRegionByKey(KeyValueTool.makeKey("cde")); assertEquals(r2.getId(), found.getId()); found = table.findRegionByKey(KeyValueTool.makeKey("efg")); assertEquals(r3.getId(), found.getId()); } }