@@ -0,0 +1,1847 @@
+package com.github.bjoernpetersen.jmusicbot.platform;%0A%0Aimport static org.junit.jupiter.api.Assertions.assertNotNull;%0Aimport static org.junit.jupiter.api.Assertions.assertSame;%0Aimport static org.junit.jupiter.api.Assertions.assertTrue;%0Aimport static org.junit.jupiter.api.Assertions.fail;%0A%0Aimport java.util.Queue;%0Aimport java.util.concurrent.BrokenBarrierException;%0Aimport java.util.concurrent.ConcurrentLinkedQueue;%0Aimport java.util.concurrent.CyclicBarrier;%0Aimport java.util.concurrent.ExecutorService;%0Aimport java.util.concurrent.Executors;%0Aimport java.util.concurrent.TimeUnit;%0Aimport java.util.concurrent.locks.Lock;%0Aimport java.util.concurrent.locks.ReentrantLock;%0Aimport org.junit.jupiter.api.Test;%0A%0Apublic class PlatformTest %7B%0A%0A  @Test%0A  void nonNull() %7B%0A    assertNotNull(Platform.get());%0A  %7D%0A%0A  @Test%0A  void initOnce() %7B%0A    Platform platform = Platform.get();%0A    Platform other = Platform.get();%0A    assertSame(platform, other);%0A  %7D%0A%0A  @Test%0A  void lockingWorks() %7B%0A    final int threads = Math.min(4, Runtime.getRuntime().availableProcessors());%0A    ExecutorService executor = Executors.newFixedThreadPool(threads);%0A    Lock lock = new ReentrantLock();%0A    CyclicBarrier start = new CyclicBarrier(threads);%0A    Queue%3CPlatform%3E results = new ConcurrentLinkedQueue%3C%3E();%0A    for (int i = 0; i %3C threads; ++i) %7B%0A      int index = i;%0A      executor.submit(() -%3E %7B%0A        try %7B%0A          start.await();%0A        %7D catch (InterruptedException %7C BrokenBarrierException e) %7B%0A          fail(e);%0A        %7D%0A        results.add(Platform.get());%0A      %7D);%0A    %7D%0A%0A    executor.shutdown();%0A    try %7B%0A      assertTrue(executor.awaitTermination(1, TimeUnit.SECONDS));%0A    %7D catch (InterruptedException e) %7B%0A      fail(e);%0A    %7D%0A%0A    Platform first = results.poll();%0A    for (Platform platform : results) %7B%0A      assertSame(first, platform);%0A    %7D%0A  %7D%0A%7D%0A

Add Platform tests