JUnit 4.13.2 Source Code Files

JUnit Source Code Files are provided in the source package file, junit-4.13.2-sources.jar.

You can browse JUnit Source Code files below:

✍: FYIcenter.com

org/junit/internal/Checks.java

package org.junit.internal;

/** @since 4.13 */
public final class Checks {

    private Checks() {}

    /**
     * Checks that the given value is not {@code null}.
     *
     * @param value object reference to check
     * @return the passed-in value, if not {@code null}
     * @throws NullPointerException if {@code value} is {@code null}
     */
    public static <T> T notNull(T value) {
        if (value == null) {
            throw new NullPointerException();
        }
        return value;
    }

    /**
     * Checks that the given value is not {@code null}, using the given message
     * as the exception message if an exception is thrown.
     *
     * @param value object reference to check
     * @param message message to use if {@code value} is {@code null}
     * @return the passed-in value, if not {@code null}
     * @throws NullPointerException if {@code value} is {@code null}
     */
    public static <T> T notNull(T value, String message) {
        if (value == null) {
            throw new NullPointerException(message);
        }
        return value;
    }
}

org/junit/internal/Checks.java

 

Or download all of them as a single archive file:

File name: junit-4.13.2-sources.jar
File size: 234540 bytes
Release date: 2021-02-13
Download 

 

Download and Install junit-4.12.jar

Download and Install junit-4.13.2.jar

Download and Install JUnit (Java Unit) Testing

⇑⇑ FAQ for JUnit (Java Unit) Testing

2016-03-28, 11000👍, 0💬