@@ -0,0 +1,1549 @@
+package de.is24.deadcode4j;%0A%0Aimport org.junit.Test;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Map;%0A%0Aimport static com.google.common.collect.Lists.newArrayList;%0Aimport static com.google.common.collect.Maps.newHashMap;%0Aimport static org.hamcrest.MatcherAssert.assertThat;%0Aimport static org.hamcrest.Matchers.hasSize;%0Aimport static org.hamcrest.Matchers.is;%0A%0Apublic final class A_Utils %7B%0A%0A    @Test%0A    public void doesNotAddNull() %7B%0A        ArrayList%3CObject%3E list = newArrayList();%0A%0A        boolean changed = Utils.addIfNonNull(list, null);%0A%0A        assertThat(%22The collection shouldn't have changed!%22, changed, is(false));%0A        assertThat(list, hasSize(0));%0A    %7D%0A%0A    @Test%0A    public void addsNotNullValue() %7B%0A        ArrayList%3CObject%3E list = newArrayList();%0A%0A        boolean changed = Utils.addIfNonNull(list, new Object());%0A%0A        assertThat(%22The collection should have changed!%22, changed, is(true));%0A        assertThat(list, hasSize(1));%0A    %7D%0A%0A    @Test%0A    public void returnsDefaultValue() %7B%0A        final int defaultValue = 42;%0A        Map%3CString, Integer%3E map = newHashMap();%0A        map.put(%22key%22, 23);%0A%0A        Integer value = Utils.getValueOrDefault(map, %22anotherKey%22, defaultValue);%0A%0A        assertThat(value, is(defaultValue));%0A    %7D%0A%0A    @Test%0A    public void returnsMappedValue() %7B%0A        final int mappedValue = 42;%0A        Map%3CString, Integer%3E map = newHashMap();%0A        map.put(%22key%22, mappedValue);%0A%0A        Integer value = Utils.getValueOrDefault(map, %22key%22, 23);%0A%0A        assertThat(value, is(mappedValue));%0A    %7D%0A%0A%7D%0A

test for Utils class