<commit_before><commit_msg>Test for Layers<commit_after>//
// Triple Play - utilities for use in PlayN-based games
// Copyright (c) 2011-2013, Three Rings Design, Inc. - All rights reserved.
// http://github.com/threerings/tripleplay/blob/master/LICENSE

package tripleplay.util;

import org.junit.Assert;
import org.junit.Test;

import playn.core.Connection;

public class LayersTest
{
    @Test
    public void testJoin () {
        class TestConn implements Connection {
            int disconnects;
            @Override public void disconnect () {
                disconnects++;
            }
        }

        Connection joined;
        joined = Layers.join();
        joined.disconnect();
        joined.disconnect();

        TestConn c1 = new TestConn();
        joined = Layers.join(c1, joined);
        joined.disconnect();
        Assert.assertEquals(c1.disconnects, 1);
        joined.disconnect();
        Assert.assertEquals(c1.disconnects, 1);
    }
}
{'fraction_non_alphanumeric': 0.10950413223140495, 'fraction_numerical': 0.014462809917355372, 'mean_word_length': 2.3413793103448275, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5994544', 'n_tokens_mistral': 287, 'n_tokens_neox': 275, 'n_words': 67}