### Question:
TextException extends RuntimeException { @Override public String getLocalizedMessage() { final Component localized = TextTranslations.translate(message, Locale.getDefault()); return PlainComponentSerializer.INSTANCE.serialize(localized); } private  TextException(
      @Nullable Throwable cause, @Nullable String suggestion, String key, Component... args); Component getText(); @Override String getLocalizedMessage(); static TextException of(String key, Component... args); static TextException noPermission(); static TextException unknown(@Nullable Throwable cause); static TextException invalidFormat(String text, Class<?> type, @Nullable Throwable cause); static TextException invalidFormat(
      String text, Class<?> type, @Nullable String suggestion, @Nullable Throwable cause); static TextException outOfRange(String text, Range<?> range);  }### Answer:
@Test void testGetLocalizedMessage() { final Throwable cause = new IllegalStateException(); final TextException error = TextException.unknown(cause); assertEquals(cause, error.getCause(), "error cause is wrong"); assertEquals("error.unknown", error.getMessage(), "error key is wrong"); final Locale jvmLocale = Locale.getDefault(); assumeTrue(jvmLocale == Locale.ROOT || jvmLocale == Locale.US, "jvm locale is not english"); assertEquals( "An unknown error occurred, please see console for details.", error.getLocalizedMessage()); }