### Question:
QRDecompositionCommons implements Decomposition<QRDecompositionResult> { @Override public QRDecompositionResult apply(DoubleMatrix x) { ArgChecker.notNull(x, "x"); RealMatrix temp = CommonsMathWrapper.wrap(x); QRDecomposition qr = new QRDecomposition(temp); return new QRDecompositionCommonsResult(qr); }  @Override QRDecompositionResult apply(DoubleMatrix x);  }### Answer:
@Test public void testNullObjectMatrix() { assertThatIllegalArgumentException() .isThrownBy(() -> QR.apply((DoubleMatrix) null)); }
@Test public void testRecoverOrginal() { final DecompositionResult result = QR.apply(A); assertThat(result instanceof QRDecompositionResult).isTrue(); final QRDecompositionResult qr = (QRDecompositionResult) result; final DoubleMatrix q = qr.getQ(); final DoubleMatrix r = qr.getR(); final DoubleMatrix a = (DoubleMatrix) ALGEBRA.multiply(q, r); checkEquals(A, a); }