### Question:
Platform extends io.dropwizard.Application<PlatformConfiguration> { public static Platform forApplication(Application application) { Preconditions.checkNotNull(application, "Application cannot be null."); return new Platform(application); } Platform(Application application); static Platform forApplication(Application application); void start(String[] args); @Override void initialize(Bootstrap<PlatformConfiguration> bootstrap); @Override void run(PlatformConfiguration configuration, Environment environment);  }### Answer:
@Test public void can_build_with_application() { Application application = mock(Application.class); when(application.getPlugins()).thenReturn(ImmutableList.<Plugin>of()); Platform.forApplication(application); }
@Test(expected = NullPointerException.class) public void cannot_build_with_null_application() { Platform.forApplication(null); }