/** * Copyright (C) 2010-2017 Gordon Fraser, Andrea Arcuri and EvoSuite * contributors * * This file is part of EvoSuite. * * EvoSuite is free software: you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation, either version 3.0 of the License, or * (at your option) any later version. * * EvoSuite is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with EvoSuite. If not, see <http://www.gnu.org/licenses/>. */ package com.examples.with.different.packagename; import static org.junit.Assert.assertEquals; import java.util.List; import org.junit.Test; /** * Snippet from Lang project * (org.apache.commons.lang3.ClassUtilsTest) */ public class ClassWithPrivateInterfacesTest { private static interface IA { } private static interface IB { } private static interface IC extends ID, IE { } private static interface ID { } private static interface IE extends IF { } private static interface IF { } private static class CX implements IB, IA, IE { } private static class CY extends CX implements IB, IC { } @Test public void testGetAllInterfaces() { final List<Class<?>> list = ClassWithPrivateInterfaces.getAllInterfaces(CY.class); assertEquals(6, list.size()); assertEquals(IB.class, list.get(0)); assertEquals(IC.class, list.get(1)); assertEquals(ID.class, list.get(2)); assertEquals(IE.class, list.get(3)); assertEquals(IF.class, list.get(4)); assertEquals(IA.class, list.get(5)); assertEquals(null, ClassWithPrivateInterfaces.getAllInterfaces(null)); } }