TxnOp { public static boolean isTxnTypeCompatible(TxnType innerTxnType, TxnType outerTxnType) { if ( outerTxnType == null ) return true; if ( Objects.equals(innerTxnType, outerTxnType) ) return true; if ( TxnType.READ.equals(innerTxnType) ) return true; if ( TxnType.WRITE.equals(outerTxnType) ) return true; if ( TxnType.READ.equals(outerTxnType) ) return false; return false; }  static void txnTypeCompatibleEx(TxnType innerTxnType, TxnType outerTxnType); static boolean isTxnTypeCompatible(TxnType innerTxnType, TxnType outerTxnType); static void compatibleWithPromote(TxnType requestedTxnType, Transactional currentTxn);  }
@Test public void test() { assertEquals(name, expected, TxnOp.isTxnTypeCompatible(innerTxnType, outerTxnType)); }