diff --git a/core-java-modules/core-java-reflection-2/src/main/java/com/baeldung/reflection/check/abstractclass/AbstractExample.java b/core-java-modules/core-java-reflection-2/src/main/java/com/baeldung/reflection/check/abstractclass/AbstractExample.java new file mode 100644 index 0000000000..e8ad3bc3bd --- /dev/null +++ b/core-java-modules/core-java-reflection-2/src/main/java/com/baeldung/reflection/check/abstractclass/AbstractExample.java @@ -0,0 +1,15 @@ +package com.baeldung.reflection.check.abstractclass; + +import java.time.LocalDate; +import java.time.LocalTime; + +public abstract class AbstractExample { + + public static String getAuthorName() { + return "Umang Budhwar"; + } + + public abstract LocalDate getLocalDate(); + + public abstract LocalTime getLocalTime(); +} diff --git a/core-java-modules/core-java-reflection-2/src/test/java/com/baeldung/reflection/check/abstractclass/AbstractExampleUnitTest.java b/core-java-modules/core-java-reflection-2/src/test/java/com/baeldung/reflection/check/abstractclass/AbstractExampleUnitTest.java new file mode 100644 index 0000000000..cb5d927c23 --- /dev/null +++ b/core-java-modules/core-java-reflection-2/src/test/java/com/baeldung/reflection/check/abstractclass/AbstractExampleUnitTest.java @@ -0,0 +1,16 @@ +package com.baeldung.reflection.check.abstractclass; + +import java.lang.reflect.Modifier; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +class AbstractExampleUnitTest { + + @Test + void givenAbstractClass_whenCheckModifierIsAbstract_thenTrue() throws Exception { + Class clazz = AbstractExample.class; + Assertions.assertTrue(Modifier.isAbstract(clazz.getModifiers())); + } + +}