### Question:
EdgeKeyDecoder { public static STATS_TYPE determineStatsType(Text colFam) { int offset = STATS_BYTES.length + 1; int secondSlashIndex = 0; int numCharsToCheck = Math.min(offset + 1 + STATS_TYPE.getMaxLength(), colFam.getLength()); for (int i = offset; i < numCharsToCheck; i++) { secondSlashIndex = i; if (colFam.getBytes()[i] == COL_SEPARATOR_BYTE) { break; } } int count = (secondSlashIndex > offset ? secondSlashIndex - offset : offset); try { return STATS_TYPE.getStatsType(Text.decode(colFam.getBytes(), offset, count)); } catch (CharacterCodingException e) { throw new RuntimeException("Edge key column encoding exception", e); } } EdgeKeyDecoder(); EdgeKey decode(Key key, EdgeKey.EdgeKeyBuilder builder); static EDGE_FORMAT determineEdgeFormat(Text colFam); static String getYYYYMMDD(Text colQual); static STATS_TYPE determineStatsType(Text colFam);  }### Answer:
@Test public void extractsEachStatsType() { for (EdgeKey.STATS_TYPE statsType : EdgeKey.STATS_TYPE.values()) { Assert.assertEquals(statsType, EdgeKeyDecoder.determineStatsType(new Text("STATS/" + statsType.name() + "/CATEGORY"))); Assert.assertEquals(statsType, EdgeKeyDecoder.determineStatsType(new Text("STATS/" + statsType.name() + "/TYPE/RELATIONSHIP/CATEGORY/ATTRIBUTE2"))); Assert.assertEquals(statsType, EdgeKeyDecoder.determineStatsType(new Text("STATS/" + statsType.name() + "/TYPE/RELATIONSHIP/"))); Assert.assertEquals(statsType, EdgeKeyDecoder.determineStatsType(new Text("STATS/" + statsType.name() + "/TYPE/RELATIONSHIP/"))); } }
@Test(expected = EnumConstantNotPresentException.class) public void throwsExceptionForInvalidStatsType() { EdgeKeyDecoder.determineStatsType(new Text("STATS }