OfframpOptions implements Serializable { public static <T> Builder<T> builder(Class<T> payloadClass) { return new Builder<T>(payloadClass); }  static Builder<T> builder(Class<T> payloadClass);  }
@Test(expected = NullPointerException.class) public void nullHost() throws Exception { OfframpOptions.builder(String.class).host(null); }
@Test(expected = NullPointerException.class) public void nullRoadName() throws Exception { OfframpOptions.builder(String.class).roadName(null); }
@Test(expected = NullPointerException.class) public void nullStreamName() throws Exception { OfframpOptions.builder(String.class).streamName(null); }
@Test(expected = NullPointerException.class) public void nullDefaultOffset() throws Exception { OfframpOptions.builder(String.class).defaultOffset(null); }
@Test public void equality() throws Exception { OfframpOptions<String> left = OfframpOptions .builder(String.class) .username("user") .password("pass") .host("host") .roadName("roadName") .streamName("streamName") .build(); OfframpOptions<String> right = OfframpOptions .builder(String.class) .username("user") .password("pass") .host("host") .roadName("roadName") .streamName("streamName") .build(); assertEquals(left, right); }
@Test public void inequality() throws Exception { OfframpOptions<String> o1 = OfframpOptions .builder(String.class) .username("user") .password("pass") .host("host") .roadName("roadName") .streamName("streamName") .build(); OfframpOptions<Byte> o2 = OfframpOptions .builder(Byte.class) .username("user") .password("pass") .host("host") .roadName("roadName") .streamName("streamName") .build(); assertNotEquals(o1, o2); OfframpOptions<String> o3 = OfframpOptions.builder(String.class) .username("user1") .password("password1") .host("host") .roadName("roadName") .streamName("streamName") .build(); OfframpOptions<String> o4 = OfframpOptions.builder(String.class) .username("user2") .password("password1") .host("host") .roadName("roadName") .streamName("streamName") .build(); assertNotEquals(o3, o4); OfframpOptions<String> o5 = OfframpOptions.builder(String.class) .username("user1") .password("password1") .host("host") .roadName("roadName") .streamName("streamName") .build(); OfframpOptions<String> o6 = OfframpOptions.builder(String.class) .username("user1") .password("password2") .host("host") .roadName("roadName") .streamName("streamName") .build(); assertNotEquals(o5, o6); }