ValidatingTransform extends Transform { @Override public Transform invert(final Transform store) { final Transform transform = super.invert(store); if (!Transform.isValid(transform)) { throw new InvalidTransformException("Transform is invalid"); } return transform; } ValidatingTransform();  ValidatingTransform(final ReadOnlyTransform source); @Override Transform fromHomogeneousMatrix(final ReadOnlyMatrix4 matrix); @Override ValidatingTransform setRotation(final ReadOnlyMatrix3 rotation); @Override ValidatingTransform setRotation(final ReadOnlyQuaternion rotation); @Override ValidatingTransform setScale(final double x, final double y, final double z); @Override ValidatingTransform setScale(final double uniformScale); @Override ValidatingTransform setScale(final ReadOnlyVector3 scale); @Override ValidatingTransform setTranslation(final double x, final double y, final double z); @Override ValidatingTransform setTranslation(final ReadOnlyVector3 translation); @Override Transform translate(final double x, final double y, final double z); @Override Transform translate(final ReadOnlyVector3 vec); @Override Transform multiply(final ReadOnlyTransform transformBy, final Transform store); @Override Transform invert(final Transform store); @Override Transform set(final ReadOnlyTransform source); @Override ValidatingTransform clone();  }
@Test(expected = InvalidTransformException.class) public void testInvert() { final ValidatingTransform vt1 = new ValidatingTransform(); vt1.setScale(2); vt1.invert(null); ((Vector3) vt1.getScale()).setX(0); vt1.invert(null); }