### Question:
RandomCutForest { public void update(double[] point) { checkNotNull(point, "point must not be null"); checkArgument(point.length == dimensions, String.format("point.length must equal %d", dimensions)); executor.update(point); } protected  RandomCutForest(Builder<?> builder); static Builder builder(); static RandomCutForest defaultForest(int dimensions, long randomSeed); static RandomCutForest defaultForest(int dimensions); int getNumberOfTrees(); int getSampleSize(); int getOutputAfter(); int getDimensions(); double getLambda(); boolean storeSequenceIndexesEnabled(); boolean centerOfMassEnabled(); boolean parallelExecutionEnabled(); int getThreadPoolSize(); void update(double[] point); S traverseForest(double[] point, Function<RandomCutTree, Visitor<R>> visitorFactory,
            BinaryOperator<R> accumulator, Function<R, S> finisher); S traverseForest(double[] point, Function<RandomCutTree, Visitor<R>> visitorFactory,
            Collector<R, ?, S> collector); S traverseForest(double[] point, Function<RandomCutTree, Visitor<R>> visitorFactory,
            ConvergingAccumulator<R> accumulator, Function<R, S> finisher); S traverseForestMulti(double[] point, Function<RandomCutTree, MultiVisitor<R>> visitorFactory,
            BinaryOperator<R> accumulator, Function<R, S> finisher); S traverseForestMulti(double[] point, Function<RandomCutTree, MultiVisitor<R>> visitorFactory,
            Collector<R, ?, S> collector); double getAnomalyScore(double[] point); double getApproximateAnomalyScore(double[] point); DiVector getAnomalyAttribution(double[] point); DiVector getApproximateAnomalyAttribution(double[] point); DensityOutput getSimpleDensity(double[] point); double[] imputeMissingValues(double[] point, int numberOfMissingValues, int[] missingIndexes); double[] extrapolateBasic(double[] point, int horizon, int blockSize, boolean cyclic, int shingleIndex); double[] extrapolateBasic(double[] point, int horizon, int blockSize, boolean cyclic); double[] extrapolateBasic(ShingleBuilder builder, int horizon); List<Neighbor> getNearNeighborsInSample(double[] point, double distanceThreshold); List<Neighbor> getNearNeighborsInSample(double[] point); boolean isOutputReady(); boolean samplersFull(); long getTotalUpdates(); static final int DEFAULT_SAMPLE_SIZE; static final double DEFAULT_OUTPUT_AFTER_FRACTION; static final double DEFAULT_SAMPLE_SIZE_COEFFICIENT_IN_LAMBDA; static final int DEFAULT_NUMBER_OF_TREES; static final boolean DEFAULT_STORE_SEQUENCE_INDEXES_ENABLED; static final boolean DEFAULT_CENTER_OF_MASS_ENABLED; static final boolean DEFAULT_PARALLEL_EXECUTION_ENABLED; static final boolean DEFAULT_APPROXIMATE_ANOMALY_SCORE_HIGH_IS_CRITICAL; static final double DEFAULT_APPROXIMATE_DYNAMIC_SCORE_PRECISION; static final int DEFAULT_APPROXIMATE_DYNAMIC_SCORE_MIN_VALUES_ACCEPTED; }### Answer:
@Test public void testUpdateInvalid() { assertThrows(NullPointerException.class, () -> forest.update(null)); assertThrows(IllegalArgumentException.class, () -> forest.update(new double[] { 1.2, 3.4, -5.6 })); }
@Test public void testUpdate() { double[] point = { 2.2, -1.1 }; forest.update(point); verify(executor, times(1)).update(point); }