getDeclaredMethod no funciona, NoSuchMethodException

He estado tratando de usarReflection En Java, pero no termina bastante bien. Aquí está mi código:

public class ReflectionTest {
    public static void main(String[] args) {
        ReflectionTest test = new ReflectionTest();
        try {
            Method m = test.getClass().getDeclaredMethod("Test");
            m.invoke(test.getClass(), "Cool story bro");
        } catch (NoSuchMethodException | SecurityException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IllegalArgumentException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    public void Test(String someawesometext) {
        System.out.println(someawesometext);
    }
}

Acabo de obtener eljava.lang.NoSuchMethodException Error, y lo he intentado casi todo. Como usargetMethod en lugar degetDeclaredMethodagregartest.getClass() después"Test" engetDeclaredMethod y más.

Aquí está la traza de la pila:

java.lang.NoSuchMethodException: ReflectionTest.Test()
at java.lang.Class.getDeclaredMethod(Unknown Source)
at ReflectionTest.main(ReflectionTest.java:10)

He estado buscando en Google por muchos días pero sin suerte. Entonces, ¿alguien sabe cómo se supone que debo arreglar esto?

Respuestas a la pregunta(4)

Su respuesta a la pregunta