### Question:
SplitTransaction { public boolean prepare() { if (this.parent.isClosed() || this.parent.isClosing()) return false; HRegionInfo hri = this.parent.getRegionInfo(); parent.prepareToSplit(); byte [] startKey = hri.getStartKey(); byte [] endKey = hri.getEndKey(); if (Bytes.equals(startKey, splitrow) || !this.parent.getRegionInfo().containsRow(splitrow)) { LOG.info("Split row is not inside region key range or is equal to " + "startkey: " + Bytes.toString(this.splitrow)); return false; } long rid = getDaughterRegionIdTimestamp(hri); this.hri_a = new HRegionInfo(hri.getTableDesc(), startKey, this.splitrow, false, rid); this.hri_b = new HRegionInfo(hri.getTableDesc(), this.splitrow, endKey, false, rid); return true; } SplitTransaction(final HRegion r, final byte [] splitrow); boolean prepare(); void rollback(final OnlineRegions or);  }### Answer:
@Test public void testPrepare() throws IOException { prepareGOOD_SPLIT_ROW(); }
@Test public void testPrepareWithBadSplitRow() throws IOException { SplitTransaction st = new SplitTransaction(this.parent, STARTROW); assertFalse(st.prepare()); st = new SplitTransaction(this.parent, HConstants.EMPTY_BYTE_ARRAY); assertFalse(st.prepare()); st = new SplitTransaction(this.parent, new byte [] {'A', 'A', 'A'}); assertFalse(st.prepare()); st = new SplitTransaction(this.parent, ENDROW); assertFalse(st.prepare()); }
@Test public void testPrepareWithClosedRegion() throws IOException { this.parent.close(); SplitTransaction st = new SplitTransaction(this.parent, GOOD_SPLIT_ROW); assertFalse(st.prepare()); }