### Question:
Signature { public static Builder builder() { return new Builder(); } Signature(String key, SignatureDef signatureDef); static Builder builder(); String key(); String methodName(); Set<String> inputNames(); Set<String> outputNames(); @Override String toString(); static final String DEFAULT_KEY; }### Answer:
@Test public void cannotDuplicateInputOutputNames() { try (Graph g = new Graph()) { Ops tf = Ops.create(g); Signature.Builder builder = Signature.builder() .input("x", tf.constant(10.0f)) .output("x", tf.constant(10.0f)) .output("y", tf.constant(20.0f)); assertThrows(IllegalArgumentException.class, () -> builder.input("x", tf.constant(10))); assertThrows(IllegalArgumentException.class, () -> builder.output("y", tf.constant(20.0f))); } }