public static CoderProvider fromStaticMethods(Class<?> rawType, Class<?> coderClazz) {
    checkArgument(
        Coder.class.isAssignableFrom(coderClazz),
        "%s is not a subtype of %s",
        coderClazz.getName(),
        Coder.class.getSimpleName());
    return new CoderProviderFromStaticMethods(rawType, coderClazz);
  }
@Test
  public void testCoderProvidersFromStaticMethodsForParameterlessTypes() throws Exception {
    CoderProvider factory = CoderProviders.fromStaticMethods(String.class, StringUtf8Coder.class);
    assertEquals(
        StringUtf8Coder.of(), factory.coderFor(TypeDescriptors.strings(), Collections.emptyList()));

    factory = CoderProviders.fromStaticMethods(Double.class, DoubleCoder.class);
    assertEquals(
        DoubleCoder.of(), factory.coderFor(TypeDescriptors.doubles(), Collections.emptyList()));

    factory = CoderProviders.fromStaticMethods(byte[].class, ByteArrayCoder.class);
    assertEquals(
        ByteArrayCoder.of(),
        factory.coderFor(TypeDescriptor.of(byte[].class), Collections.emptyList()));
  }