DestinationHelper { public static String filterExpression(final String configured, final ConsumeDestination legacy) { return Optional.ofNullable(legacy).map((d) -> d.getFilterExpression()).orElse(configured); }  static void mustHaveEither(String configured, ConsumeDestination legacy); static void mustHaveEither(String configured, ProduceDestination legacy); static String consumeDestination(final String configured,
      final ConsumeDestination legacy); static String filterExpression(final String configured,
      final ConsumeDestination legacy); static String threadName(final AdaptrisMessageListener listener, final ConsumeDestination legacy); static String threadName(final AdaptrisMessageListener listener,
      final ConsumeDestination legacy, String defaultName); static String resolveProduceDestination(String configured, ProduceDestination legacy,
      AdaptrisMessage msg); @Deprecated static void logConsumeDestinationWarning(boolean alreadyLogged,
      WarningLoggedCallback callback,
      ConsumeDestination d, String text,
      Object... args); static void logWarningIfNotNull(boolean alreadyLogged,
      WarningLoggedCallback callback, Object d, String text, Object... args);  }
@Test public void testFilterExpression() { assertNull(filterExpression(null, null)); assertEquals("x", filterExpression("x", null)); assertEquals("filter", filterExpression(null, new ConfiguredConsumeDestination("dest", "filter", "threadname"))); assertEquals("filter", filterExpression("y", new ConfiguredConsumeDestination("dest", "filter", "threadname"))); }