diff --git a/wpilibjIntegrationTests/build.gradle b/wpilibjIntegrationTests/build.gradle
index d2daeda..06d891a 100644
--- a/wpilibjIntegrationTests/build.gradle
+++ b/wpilibjIntegrationTests/build.gradle
@@ -16,7 +16,9 @@
 apply plugin: 'com.github.johnrengelman.shadow'
 
 repositories {
-    mavenCentral()
+    maven {
+        url = 'https://frcmaven.wpi.edu/artifactory/ex-mvn'
+    }
 }
 
 dependencies {
@@ -24,6 +26,7 @@
     implementation project(':wpimath')
     implementation project(':hal')
     implementation project(':wpiutil')
+    implementation project(':wpinet')
     implementation project(':ntcore')
     implementation project(':cscore')
     implementation project(':cameraserver')
diff --git a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/AbstractInterruptTest.java b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/AbstractInterruptTest.java
index 219a611..bdc4675 100644
--- a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/AbstractInterruptTest.java
+++ b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/AbstractInterruptTest.java
@@ -52,7 +52,7 @@
   abstract void setInterruptLow();
 
   @Test(timeout = 1000)
-  public void testSingleInterruptsTriggering() throws Exception {
+  public void testSingleInterruptsTriggering() {
     // Given
     // final InterruptCounter counter = new InterruptCounter();
     // TestInterruptHandlerFunction function = new
diff --git a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/DriverStationTest.java b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/DriverStationTest.java
index b2e727d..cd67cbd 100644
--- a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/DriverStationTest.java
+++ b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/DriverStationTest.java
@@ -6,6 +6,8 @@
 
 import static org.junit.Assert.assertEquals;
 
+import edu.wpi.first.hal.DriverStationJNI;
+import edu.wpi.first.util.WPIUtilJNI;
 import edu.wpi.first.wpilibj.test.AbstractComsSetup;
 import java.util.logging.Logger;
 import org.junit.Test;
@@ -24,13 +26,23 @@
   public void waitForDataTest() {
     long startTime = RobotController.getFPGATime();
 
+    int handle = WPIUtilJNI.createEvent(false, false);
+    DriverStationJNI.provideNewDataEventHandle(handle);
+
     // Wait for data 50 times
     for (int i = 0; i < 50; i++) {
-      DriverStation.waitForData();
+      try {
+        WPIUtilJNI.waitForObject(handle);
+      } catch (InterruptedException e) {
+        e.printStackTrace();
+      }
     }
     long endTime = RobotController.getFPGATime();
     long difference = endTime - startTime;
 
+    DriverStationJNI.removeNewDataEventHandle(handle);
+    WPIUtilJNI.destroyEvent(handle);
+
     assertEquals(
         "DriverStation waitForData did not wait long enough",
         TIMER_RUNTIME,
diff --git a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/MockDS.java b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/MockDS.java
index dfd5b6c..36bd2e8 100644
--- a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/MockDS.java
+++ b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/MockDS.java
@@ -22,7 +22,7 @@
     data[5] = 0x00; // red 1 station
   }
 
-  @SuppressWarnings("MissingJavadocMethod")
+  /** Start the mock DS thread. */
   public void start() {
     m_thread =
         new Thread(
@@ -67,7 +67,7 @@
     m_thread.start();
   }
 
-  @SuppressWarnings("MissingJavadocMethod")
+  /** Stop the mock DS thread. */
   public void stop() {
     if (m_thread == null) {
       return;
diff --git a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PCMTest.java b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PCMTest.java
index 07e0139..e571ffa 100644
--- a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PCMTest.java
+++ b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PCMTest.java
@@ -70,7 +70,7 @@
 
   /** Test if the compressor turns on and off when the pressure switch is toggled. */
   @Test
-  public void testPressureSwitch() throws Exception {
+  public void testPressureSwitch() {
     final double range = 0.5;
     reset();
     pcm.enableCompressorDigital();
@@ -96,7 +96,7 @@
 
   /** Test if the correct solenoids turn on and off when they should. */
   @Test
-  public void testSolenoid() throws Exception {
+  public void testSolenoid() {
     reset();
 
     Solenoid solenoid1 = new Solenoid(PneumaticsModuleType.CTREPCM, 0);
@@ -174,7 +174,7 @@
 
   /** Test if the correct solenoids turn on and off when they should. */
   @Test
-  public void testOneShot() throws Exception {
+  public void testOneShot() {
     reset();
 
     Solenoid solenoid1 = new Solenoid(PneumaticsModuleType.CTREPCM, 0);
diff --git a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PDPTest.java b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PDPTest.java
index 548c2e0..f2bc522 100644
--- a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PDPTest.java
+++ b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PDPTest.java
@@ -45,7 +45,12 @@
     me = null;
   }
 
-  @SuppressWarnings("MissingJavadocMethod")
+  /**
+   * PDPTest constructor.
+   *
+   * @param mef Motor encoder fixture.
+   * @param expectedCurrentDraw Expected current draw in Amps.
+   */
   public PDPTest(MotorEncoderFixture<?> mef, Double expectedCurrentDraw) {
     logger.fine("Constructor with: " + mef.getType());
     if (me != null && !me.equals(mef)) {
diff --git a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PIDTest.java b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PIDTest.java
index c8afb4b..b5e0fc8 100644
--- a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PIDTest.java
+++ b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PIDTest.java
@@ -41,24 +41,32 @@
   private PIDController m_controller = null;
   private static MotorEncoderFixture<?> me = null;
 
-  @SuppressWarnings({"MemberName", "EmptyLineSeparator", "MultipleVariableDeclarations"})
-  private final Double k_p, k_i, k_d;
+  private final Double m_p;
+  private final Double m_i;
+  private final Double m_d;
 
   @Override
   protected Logger getClassLogger() {
     return logger;
   }
 
-  @SuppressWarnings({"ParameterName", "MissingJavadocMethod"})
+  /**
+   * PIDTest constructor.
+   *
+   * @param p P gain.
+   * @param i I gain.
+   * @param d D gain.
+   * @param mef Motor encoder fixture.
+   */
   public PIDTest(Double p, Double i, Double d, MotorEncoderFixture<?> mef) {
     logger.fine("Constructor with: " + mef.getType());
     if (PIDTest.me != null && !PIDTest.me.equals(mef)) {
       PIDTest.me.teardown();
     }
     PIDTest.me = mef;
-    this.k_p = p;
-    this.k_i = i;
-    this.k_d = d;
+    this.m_p = p;
+    this.m_i = i;
+    this.m_d = d;
   }
 
   @Parameters
@@ -97,7 +105,7 @@
     m_table = NetworkTableInstance.getDefault().getTable("TEST_PID");
     m_builder = new SendableBuilderImpl();
     m_builder.setTable(m_table);
-    m_controller = new PIDController(k_p, k_i, k_d);
+    m_controller = new PIDController(m_p, m_i, m_d);
     m_controller.initSendable(m_builder);
   }
 
@@ -128,9 +136,9 @@
         m_controller.getPositionError(),
         0);
     m_builder.update();
-    assertEquals(k_p, m_table.getEntry("Kp").getDouble(9999999), 0);
-    assertEquals(k_i, m_table.getEntry("Ki").getDouble(9999999), 0);
-    assertEquals(k_d, m_table.getEntry("Kd").getDouble(9999999), 0);
+    assertEquals(m_p, m_table.getEntry("Kp").getDouble(9999999), 0);
+    assertEquals(m_i, m_table.getEntry("Ki").getDouble(9999999), 0);
+    assertEquals(m_d, m_table.getEntry("Kd").getDouble(9999999), 0);
     assertEquals(reference, m_table.getEntry("reference").getDouble(9999999), 0);
     assertFalse(m_table.getEntry("enabled").getBoolean(true));
   }
diff --git a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/MotorEncoderFixture.java b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/MotorEncoderFixture.java
index 220db18..ca93c4a 100644
--- a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/MotorEncoderFixture.java
+++ b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/MotorEncoderFixture.java
@@ -38,7 +38,7 @@
   public abstract int getPDPChannel();
 
   /**
-   * Where the implementer of this class should pass the speed controller Constructor should only be
+   * Where the implementer of this class should pass the motor controller Constructor should only be
    * called from outside this class if the Motor controller is not also an implementation of PWM
    * interface.
    *
@@ -75,7 +75,7 @@
         m_encoder = new Encoder(m_alphaSource, m_betaSource);
         m_counters[0] = new Counter(m_alphaSource);
         m_counters[1] = new Counter(m_betaSource);
-        logger.fine("Creating the speed controller!");
+        logger.fine("Creating the motor controller!");
         m_motor = giveMotorController();
       }
     }
@@ -152,7 +152,6 @@
    * deallocated.
    */
   @Override
-  @SuppressWarnings("Regexp")
   public void teardown() {
     if (!m_tornDown) {
       if (m_motor != null) {
diff --git a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/AbstractComsSetup.java b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/AbstractComsSetup.java
index 734115c..056ff5f 100644
--- a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/AbstractComsSetup.java
+++ b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/AbstractComsSetup.java
@@ -4,6 +4,7 @@
 
 package edu.wpi.first.wpilibj.test;
 
+import edu.wpi.first.hal.DriverStationJNI;
 import edu.wpi.first.hal.HAL;
 import edu.wpi.first.wpilibj.DriverStation;
 import edu.wpi.first.wpilibj.MockDS;
@@ -40,7 +41,7 @@
       try {
         // Set some implementations so that the static methods work properly
         HAL.initialize(500, 0);
-        HAL.observeUserProgramStarting();
+        DriverStationJNI.observeUserProgramStarting();
         DriverStation.getAlliance();
 
         ds = new MockDS();
@@ -56,6 +57,7 @@
 
       // Wait until the robot is enabled before starting the tests
       int enableCounter = 0;
+      DriverStation.refreshData();
       while (!DriverStation.isEnabled()) {
         if (enableCounter > 50) {
           // Robot did not enable properly after 5 seconds.
@@ -69,6 +71,7 @@
           ex.printStackTrace();
         }
         TestBench.out().println("Waiting for enable: " + enableCounter++);
+        DriverStation.refreshData();
       }
       TestBench.out().println();
 
diff --git a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/AbstractTestSuiteTest.java b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/AbstractTestSuiteTest.java
index c41ff8a..1e48c9c 100644
--- a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/AbstractTestSuiteTest.java
+++ b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/AbstractTestSuiteTest.java
@@ -122,8 +122,7 @@
   public static final String METHODNAME = "aTestMethod";
 
   @Test
-  @SuppressWarnings("MethodName")
-  public void aTestMethod() {}
+  public void testMethod() {}
 }
 
 @SuppressWarnings("OneTopLevelClass")
diff --git a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/TestBench.java b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/TestBench.java
index 8e63dc9..258d640 100644
--- a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/TestBench.java
+++ b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/TestBench.java
@@ -210,7 +210,7 @@
     return pairs;
   }
 
-  @SuppressWarnings("MissingJavadocMethod")
+  /** Returns the analog I/O cross-connect fixture. */
   public static AnalogCrossConnectFixture getAnalogCrossConnectFixture() {
     return new AnalogCrossConnectFixture() {
       @Override
@@ -225,7 +225,7 @@
     };
   }
 
-  @SuppressWarnings("MissingJavadocMethod")
+  /** Returns the relay cross-connect fixture. */
   public static RelayCrossConnectFixture getRelayCrossConnectFixture() {
     return new RelayCrossConnectFixture() {
       @Override
@@ -311,21 +311,6 @@
   }
 
   /**
-   * Gets the singleton of the TestBench. If the TestBench is not already allocated in constructs an
-   * new instance of it. Otherwise it returns the existing instance.
-   *
-   * @return The Singleton instance of the TestBench
-   * @deprecated Use the static methods instead
-   */
-  @Deprecated
-  public static TestBench getInstance() {
-    if (instance == null) {
-      instance = new TestBench();
-    }
-    return instance;
-  }
-
-  /**
    * Provides access to the output stream for the test system. This should be used instead of
    * System.out This is gives us a way to implement changes to where the output text of this test
    * system is sent.
