package eu.nerro.wolappla.entity;

import org.junit.Test;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.junit.Assert.assertThat;

public class MagicPacketTest {
  @Test
  public void getSynchronizationStream_shouldNotBeNull() {
    MagicPacket magicPacket = new MagicPacket();
    byte[] synchronizationStream = magicPacket.getSynchronizationStream();

    assertThat(synchronizationStream, is(notNullValue()));
  }

  @Test
  public void getSynchronizationStream_lengthShouldBeSix() {
    MagicPacket magicPacket = new MagicPacket();
    byte[] stream = magicPacket.getSynchronizationStream();

    assertThat(stream.length, is(6));
  }

  @Test
  public void getSynchronizationStream_shouldBeSixBytesOf0xff() {
    MagicPacket magicPacket = new MagicPacket();
    byte[] actualStream = magicPacket.getSynchronizationStream();
    byte[] expectedStream = {(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff};

    assertThat(actualStream, equalTo(expectedStream));
  }
}

package eu.nerro.wolappla.entity;

import org.junit.Test;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.junit.Assert.assertThat;

public class MagicPacketTest {
  @Test
  public void getSynchronizationStream_shouldNotBeNull() {
    MagicPacket magicPacket = new MagicPacket();
    byte[] synchronizationStream = magicPacket.getSynchronizationStream();

    assertThat(synchronizationStream, is(notNullValue()));
  }

  @Test
  public void getSynchronizationStream_arrayLengthShouldBeSix() {
    MagicPacket magicPacket = new MagicPacket();
    byte[] stream = magicPacket.getSynchronizationStream();

    assertThat(stream.length, is(6));
  }

  @Test
  public void getSynchronizationStream_shouldContainSixBytesOf0xFF() {
    MagicPacket magicPacket = new MagicPacket();
    byte[] actualStream = magicPacket.getSynchronizationStream();
    byte[] expectedStream = {(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff};

    assertThat(actualStream, equalTo(expectedStream));
  }
}

Use better method names in unit test of magic packet