@Test public void objectWithTheSameNameExists_false_if_same_object() { SharedObjectInterface sharedObject = mock( SharedObjectInterface.class ); when( sharedObject.getName() ).thenReturn( "TEST_OBJECT" ); assertFalse( objectWithTheSameNameExists( sharedObject, Collections.singleton( sharedObject ) ) ); }
public static boolean objectWithTheSameNameExists( SharedObjectInterface object, Collection<? extends SharedObjectInterface> scope ) { for ( SharedObjectInterface element : scope ) { String elementName = element.getName(); if ( elementName != null && elementName.equalsIgnoreCase( object.getName() ) && object != element ) { return true; } } return false; }
DialogUtils { public static boolean objectWithTheSameNameExists( SharedObjectInterface object, Collection<? extends SharedObjectInterface> scope ) { for ( SharedObjectInterface element : scope ) { String elementName = element.getName(); if ( elementName != null && elementName.equalsIgnoreCase( object.getName() ) && object != element ) { return true; } } return false; } }
DialogUtils { public static boolean objectWithTheSameNameExists( SharedObjectInterface object, Collection<? extends SharedObjectInterface> scope ) { for ( SharedObjectInterface element : scope ) { String elementName = element.getName(); if ( elementName != null && elementName.equalsIgnoreCase( object.getName() ) && object != element ) { return true; } } return false; }  }
DialogUtils { public static boolean objectWithTheSameNameExists( SharedObjectInterface object, Collection<? extends SharedObjectInterface> scope ) { for ( SharedObjectInterface element : scope ) { String elementName = element.getName(); if ( elementName != null && elementName.equalsIgnoreCase( object.getName() ) && object != element ) { return true; } } return false; }  static String getPathOf( RepositoryElementMetaInterface object ); static boolean objectWithTheSameNameExists( SharedObjectInterface object,
      Collection<? extends SharedObjectInterface> scope ); static String getPath( String parentPath, String path ); }
DialogUtils { public static boolean objectWithTheSameNameExists( SharedObjectInterface object, Collection<? extends SharedObjectInterface> scope ) { for ( SharedObjectInterface element : scope ) { String elementName = element.getName(); if ( elementName != null && elementName.equalsIgnoreCase( object.getName() ) && object != element ) { return true; } } return false; }  static String getPathOf( RepositoryElementMetaInterface object ); static boolean objectWithTheSameNameExists( SharedObjectInterface object,
      Collection<? extends SharedObjectInterface> scope ); static String getPath( String parentPath, String path );  }