@@ -0,0 +1,2076 @@
+/*%0A * Copyright 2013-2016 Netherlands Forensic Institute%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage io.parsingdata.metal.token;%0A%0Aimport io.parsingdata.metal.data.ParseResult;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.junit.rules.ExpectedException;%0A%0Aimport java.io.IOException;%0A%0Aimport static io.parsingdata.metal.Shorthand.*;%0Aimport static io.parsingdata.metal.util.EncodingFactory.enc;%0Aimport static io.parsingdata.metal.util.EnvironmentFactory.stream;%0Aimport static org.hamcrest.CoreMatchers.is;%0Aimport static org.hamcrest.MatcherAssert.assertThat;%0Aimport static org.junit.Assert.assertFalse;%0A%0Apublic class NodTest %7B%0A%0A    private static final Token NOD = nod(con(4));%0A    private static final Token NOD_REF_SIZE = nod(ref(%22size%22));%0A    private static final Token FOUND_REF = seq(def(%22size%22, con(1)), NOD_REF_SIZE);%0A%0A    @Rule%0A    public ExpectedException thrown = ExpectedException.none();%0A%0A    @Test%0A    public void nodSkipsData() throws IOException %7B%0A        ParseResult parseResult = NOD.parse(stream(1, 1, 1, 1), enc());%0A        assertThat(parseResult.getEnvironment().offset, is(4L));%0A    %7D%0A%0A    @Test%0A    public void nodWithRefSize() throws IOException %7B%0A        ParseResult parseResult = FOUND_REF.parse(stream(1, 1), enc());%0A        // 1 byte size, 1 byte nod:%0A        assertThat(parseResult.getEnvironment().offset, is(2L));%0A    %7D%0A%0A    @Test%0A    public void nodWithoutSize() throws IOException %7B%0A        ParseResult parseResult = NOD_REF_SIZE.parse(stream(), enc());%0A        assertFalse(parseResult.succeeded());%0A    %7D%0A%0A%7D%0A

Add Nod tests.